// author: Oscar Ramos

/// Source Code
// const input = require('competitive-programming-js').inputReader
// const { forn } = require('../utils/utils')
//
// const [n, k] = input.readNumberArray()
//
// const a = input.readNumberArray()
//
// a.sort((x, y) => y-x)
//
// let cnt = 0
// forn(n, idx => {
//   if(a[idx] > 0 && a[idx] >= a[k-1])
//     cnt++
// })
//
// console.log(cnt)
//

!function(t){var n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)r.d(e,o,function(n){return t[n]}.bind(null,o));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=1)}([function(t,n){t.exports=function(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}},function(t,n,r){t.exports=r(2)},function(t,n,r){let e,o=0,u={readNumberArray:function(){return e[o++].split(" ").map(t=>Number(t))}};var i="";process.stdin.resume(),process.stdin.setEncoding("utf8"),process.stdin.on("data",(function(t){i+=t})).on("end",(function(){e=i.trim().split("\n").map(t=>t.trim());const{forn:t}=r(3),[n,o]=u.readNumberArray(),c=u.readNumberArray();c.sort((t,n)=>n-t);let f=0;t(n,t=>{c[t]>0&&c[t]>=c[o-1]&&f++}),console.log(f)}))},function(t,n,r){const e=r(4);t.exports={forn:(t,n)=>e(0,t).map(t=>n(t)),fornm:(t,n,r)=>e(0,t).map(t=>e(0,n).map(n=>r(t,n))),matrix:(t,n,r)=>e(0,t).map(()=>e(0,n).map(()=>r))}},function(t,n,r){var e=r(5),o=r(7),u=e((function(t,n){if(!o(t)||!o(n))throw new TypeError("Both arguments to range must be numbers");for(var r=[],e=t;e<n;)r.push(e),e+=1;return r}));t.exports=u},function(t,n,r){var e=r(6),o=r(0);t.exports=function(t){return function n(r,u){switch(arguments.length){case 0:return n;case 1:return o(r)?n:e((function(n){return t(r,n)}));default:return o(r)&&o(u)?n:o(r)?e((function(n){return t(n,u)})):o(u)?e((function(n){return t(r,n)})):t(r,u)}}}},function(t,n,r){var e=r(0);t.exports=function(t){return function n(r){return 0===arguments.length||e(r)?n:t.apply(this,arguments)}}},function(t,n){t.exports=function(t){return"[object Number]"===Object.prototype.toString.call(t)}}]);

/// package.json
// {
//   "name": "competitive",
//   "version": "1.0.0",
//   "description": "",
//   "main": "src/index.js",
//   "scripts": {
//     "convert": "cp-convert -s src/index.js -d output/converted.js",
//     "bundle": "webpack --config ./webpack.config.js",
//     "test": "npm run convert && jest ./",
//     "production": "npm run convert && npm run bundle && node src/getOutput.js",
//     "start": "node src/index.js"
//   },
//   "author": "Oscar Ramos",
//   "dependencies": {
//     "child-process-promise": "^2.2.1",
//     "competitive-programming-js": "^1.0.10",
//     "mathball": "^0.4.0",
//     "ramda": "^0.27.1"
//   },
//   "devDependencies": {
//     "@types/jest": "^26.0.10",
//     "concat-stream": "^2.0.0",
//     "cross-spawn": "^7.0.3",
//     "jest": "^26.4.2",
//     "jest-expect-message": "^1.0.2",
//     "mock-stdin": "^1.0.0",
//     "terser-webpack-plugin": "^4.1.0",
//     "webpack": "^4.44.1",
//     "webpack-cli": "^3.3.12"
//   },
//   "jest": {
//     "setupFilesAfterEnv": ["jest-expect-message"]
//   }
// }
//


const readline = require('readline');

let secondLine = false;

// Create readline Interface
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let inputs = [];

rl.on('line', lineInput => {
    inputs.push(lineInput);
})

// Read Inputs
rl.on('close', () => {
    const line1 = inputs[0].split(' ');
    const r = parseInt(line1[0]);
    const c = parseInt(line1[1]);

    const rows = [];
    let clearRows = 0;
    let clearCols = 0;

    // rows
    for (let i = 1; i < r + 1; i++) {
        const row = inputs[i];
        rows.push(row)
        if (!row.split('').includes('S'))
            clearRows++;
    }

    // // cols
    for (let i = 0; i < c; i++) {
        let f = 0;
        for (let j = 0; j < r; j++) {
            const box = rows[j].split('')[i];
            if (box === 'S') { f = 1; break; }
        }
        if (!f)
            clearCols++;
    }
    let overlaps = clearCols * clearRows;
    let maximumCakes = ((clearCols * r) + (clearRows * c)) - overlaps

    console.log(maximumCakes)

});


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
  inputString += inputStdin;
});

process.stdin.on('end', _ => {
  inputString = inputString.trim().split('\n').map(string => {
    return string.trim();
  });

  main();
});

function readline() {
  return inputString[currentLine++];
}

function print(s) {
  process.stdout.write(`${s}`);
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  // input
  let n = readline();
  const numbers = readline().split(' ').map(x => parseInt(x))
    .sort((a, b) => a - b);

  // output
  print(numbers.join(' '));
}


const readline = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});

readline.on("line", (line) => {
  const N = +line.split(" ")[0];
  const M = +line.split(" ")[1];
  const A = +line.split(" ")[2];
  readline.close();
  main(N, M, A);
  return;
});

const main = (w, h, A) => {
  const ceilsForWidth = Math.ceil(w / A);
  const ceilsForHeight = Math.ceil(h / A);
  console.log(ceilsForWidth * ceilsForHeight);
};


var read = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function (input) { inLine.push(input); });
read.on('close', function () {
    obj = init(inLine);
    myerr("-----start-----");
    var start = new Date();
    Main();
    var end = new Date() - start;
    myerr("----- end -----");
    myerr("Time: " + (end) + "ms");
    myerr("Memory: " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function nextInt() { return myconv(next(), 1); }
function nextStrArray() { return myconv(next(), 2); }
function nextIntArray() { return myconv(next(), 4); }
function nextCharArray() { return myconv(next(), 6); }
function next() { return obj.next(); }
function hasNext() { return obj.hasNext(); }
function init(input) {
    var returnObj = {
        list: input, index: 0, max: input.length,
        hasNext: function () { return (this.index < this.max); },
        next: function () { if (!this.hasNext()) { throw "ArrayIndexOutOfBoundsException"; } else { var returnInput = this.list[this.index]; this.index++; return returnInput; } }
    };
    return returnObj;
}
function myout(s) { console.log(s); }
function myerr(s) { console.error("debug:" + require("util").inspect(s, false, null)); }
function myconv(i, no) { try { switch (no) { case 1: return parseInt(i); case 2: return i.split(" "); case 4: return i.split(" ").map(Number); case 6: return i.split(""); case 7: return i.split("").map(Number); case 8: return i.join(" "); case 9: return i.join("\n"); case 0: return i.join(""); default: return i; } } catch (e) { return i; } }

function Main() {
    var str1 = next();
    var str2 = next();

    myout(str1.localeCompare(str2, 'en', { sensitivity: 'base' }));

} // Use Terminal to debug, not Debug Console!


let string = ''
process.stdin.setEncoding('ASCII')
process.stdin.on('data', (data) => string += data)

const gcd = (a, b) => {
    if (a % b == 0) return b;
    return gcd(b, a % b);
}

const main = (input) => {
    let n = Number(input[0]);
    let list = input[1].split(' ').map(Number), ans = list[0];
    for (let i = 1; i < list.length; ++i) ans = gcd(ans, list[i]);
    console.log( ans * n );
}

process.stdin.on('end', () => main(string.trim().split('\n')))


let i = '';
process.stdin.on('data', (c) => {
  i += c;
});
process.stdin.on('end', () => {
  const { EOL } = require('os');
  const lines = i.split(EOL);
  getMaxMin(...lines[0].split(' '));
});

function getMaxMin(n, l, r) {
  n = parseInt(n, 10);
  l = parseInt(l, 10);
  r = parseInt(r, 10);
  // get max
  let unique = 1;
  const arr = [];
  let curr = 1;
  while (unique < r && arr.length < n) {
    unique++;
    arr.push(curr);
    curr *= 2;
  }

  while (arr.length < n) {
    arr.push(curr);
  }

  const max = arr.reduce((a, b) => a + b);

  let index = arr.length - 1;

  // first pass
  while (index > 0 && arr[index] === curr) {
    arr[index] = 1;
    index--;
    if (arr[index] !== curr && unique === l) {
      arr[index + 1] = curr;
    }
  }

  unique--;

  while (index > 0 && unique > l && arr[index] !== 1) {
    arr[index] = 1;
    unique--;
    index--;
  }

  const min = arr.reduce((a, b) => a + b);
  console.log(`${min} ${max}`);
}


function main(input) {

        var a,b,c;
        var d =[];
        var x=[];
        input =input.split(/\n/g);
        var arr = input[0].split(' ').map(Number);

        x[0]=arr[0];
        x[1]=arr[1];
        x[2]=arr[2];
        //console.log(x);
        var dis=arr[3];

        x.sort(function(a, b){return a - b});
         //console.log(x);

        d[0]=Math.abs(x[0]-x[1]);
        d[1]=Math.abs(x[0]-x[2]);
        d[2]=Math.abs(x[1]-x[2]);
        //console.log(d);
        var m = Math.min(...d);
        //console.log(m)
        if(m>=dis){
            console.log(0);
            return;
        }

        var time=0;
             if(d[0]<dis){
                 time=time+dis-d[0];
                 //console.log(time);
                 x[0]=x[0]-(dis-d[0]);

                 d[0]=Math.abs(x[0]-x[1]);
                 d[1]=Math.abs(x[0]-x[2]);
             }
             //console.log(x);
             //console.log(d);
            if(d[1]<dis){
                 time=time+dis-d[1];
                 //console.log(time);
                 x[2]=x[2]+dis-d[1];
                d[1]=Math.abs(x[0]-x[2]);
                d[2]=Math.abs(x[1]-x[2]);
             }
            // console.log(x);
             //console.log(d);
            if(d[2]<dis){
                 //console.log(time);
                 time=time+dis-d[2];
                  //console.log(time);
                 //console.log(dis-d[2]);
                 x[2]=x[2]+dis-d[2];
                d[1]=Math.abs(x[0]-x[2]);
                d[2]=Math.abs(x[1]-x[2]);
             }
             //console.log(x);
             //console.log(d);

        console.log(time);
        return ;

}

process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";

process.stdin.on("data", function (input) {
    stdin_input += input;
});

process.stdin.on("end", function () {
   main(stdin_input);
});


// Sample code to perform I/O:

process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";

process.stdin.on("data", function (input) {
    stdin_input += input;                               // Reading input from STDIN
});

process.stdin.on("end", function () {
    main(stdin_input);
});

function main(input) {
    let output = nameLookUp(input);
    process.stdout.write(output);       // Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

// Write your code here
function nameLookUp(str) {

    let inputs = str.trim().split(' ').map(num => Number(num));
    let minSocks = Math.min(...inputs);
    let maxSocks = Math.max(...inputs);
    let wearSameSocks = Math.floor((maxSocks - minSocks) / 2) > 0 ? Math.floor((maxSocks - minSocks) / 2) : 0;

    return minSocks + ' ' + wearSameSocks.toString();
}


let data = '';
process.stdin.on('data', c => data += c);

function* nextLine() {
	let lines = data.trim().split(/\n/g);
	for(let l of lines){
		yield l.trim();
	}
}

let nl = nextLine();

nl.elem = function(funParse) {
		return funParse(this.next().value);
	};

nl.array = function(funParse) {
		return this.next().value.split(/\s/g).map(funParse||(x => x));
	};

nl.num = function() {
		return nl.elem(Number);
	};

nl.nums = function() {
		return nl.array(Number);
	};

nl.line = function() {
		return this.next().value;
	};

const sol = () => {
  let a = [];
	for(let i = 0; i < 6; i++){
    a.push(nl.num());
  }
  let sum = 0;
  if (a[5] > a[4]){
    let x = Math.min(a[1],a[2],a[3]);
    sum += x * a[5];
    sum += Math.min(a[0],a[3] - x) * a[4];
  } else {
    let x = Math.min(a[0],a[3]);
    sum += x * a[4];
    sum += Math.min(a[1],a[2],a[3] - x) * a[5];
  }
	console.log(sum);

};

process.stdin.on('end', sol);


var readline = require('readline');

var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

function ans(line) {

}

String.prototype.answerString = function () {
    line = this.valueOf();
    return line.toLowerCase().split('').map((e) => {return 'aeiouy'.includes(e) ? '':`.${e}`}).join('');
}

rl.on('line', function (line) {
  console.log(line.answerString());
});


var stdin = "";
process.stdin.resume();
process.stdin.setEncoding("ascii");
process.stdin.on("data", function(data) {
  stdin += data;
});
process.stdin.on("end", function() {
  main(stdin);
});

const debug = 0;
var log = console.log;
var dbg = debug ? console.log : _ => {};

/////////////// ignore above this line ////////////////////

function main(stdin) {
  if (stdin > 3) {
    log(stdin % 2 ? "NO" : "YES");
  } else {
    log("NO");
  }
}


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (str) => {
  if (c === 0) {
    c++;
    return;
  }

  let v = 0;
  let inc = 1;
  let ans = '';

  while (v < str.length) {
    ans += str[v];
    v += inc;
    inc++;
  }

  console.log(ans);

  c++;
});


const readline = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});

readline.question('', w => {
  if (w <= 2 || w % 2 !== 0) {
    console.log("NO");
  } else {
    console.log("YES");
  }
  readline.close();
});


let i = ''

process.stdin.on('data',c => {
    i += c
})

process.stdin.on('end', () => {
    const { EOL } = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/

    let inputData = lines[0].split(" ")
    let tableSize = parseInt(inputData[0])
    let desiredNumber = parseInt(inputData[1])
    let numberOfOccurrence = 0

    for(i = 1; i <= tableSize; i++) {
        if ( desiredNumber / i <= tableSize && desiredNumber % i === 0 ) {
            numberOfOccurrence++
        }
    }
    console.log(numberOfOccurrence)
})


const readline = require('readline');

let inputs = [];

// Create readline Interface
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})

// Read Inputs
rl.on('line', lineInput => {
    inputs.push(lineInput);
})

// Excute algorithm
rl.on('close', () => {
    let statement = inputs[0].split('+');
    statement.sort((a, b) => a - b);
    console.log(statement.join('+'))
})


let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL) ;/*your input text, split by lines*/
    const k = lines[0];
    const arr = lines.slice(1, lines.length).filter(l => l).map(l => parseInt(l));

    if ((arr.reduce((a, v) => a + v, 0) % 360) === 0) {
    	console.log("YES");
    	return;
    }

   	function subseqs(arr, k) {
			const n = arr.length;
			const res = [];
			let j = 0;

			for (let mask = 0; mask < (1 << n); mask++) {
				let num = 0;

				for (let i = 0; i < n; i++) {
					if (mask & (1 << i)) {
						num++;
					}
				}

				if (num === k) {
					res[j] = [0, 0];

					for (let i = 0; i < n; i++) {
						if (mask & (1 << i)) {
							res[j][0] = (res[j][0] + arr[i]) % 360;
						} else {
							res[j][1] = (res[j][1] + arr[i]) % 360;
						}
					}

					j++;
				}
			}

			return res;
		}

	for (let i = 1; i < arr.length / 2 + 1; i++) {
		for (const ss of subseqs(arr, i)) {
			if (ss[0] === ss[1]) {
				console.log("YES");
				return;
			}
		}
	}

	console.log("NO");
});

// const lines = `15
// 168
// 168
// 168
// 168
// 168
// 168
// 168
// 168
// 168
// 168
// 168
// 168
// 168
// 168
// 168`.split('\n');
//
// const k = lines[0];
// const arr = lines.slice(1, lines.length).filter(l => l).map(l => parseInt(l));
//
// if ((arr.reduce((a, v) => a + v, 0) % 360) === 0) {
// 	console.log("YES");
// 	proccess.exit(0);
// }
//
// function subseqs(arr, k) {
// 	const n = arr.length;
// 	const res = [];
// 	let j = 0;
//
// 	for (let mask = 0; mask < (1 << n); mask++) {
// 		let num = 0;
//
// 		for (let i = 0; i < n; i++) {
// 			if (mask & (1 << i)) {
// 				num++;
// 			}
// 		}
//
// 		if (num === k) {
// 			res[j] = [0, 0];
//
// 			for (let i = 0; i < n; i++) {
// 				if (mask & (1 << i)) {
// 					res[j][0] = (res[j][0] + arr[i]) % 360;
// 				} else {
// 					res[j][1] = (res[j][1] + arr[i]) % 360;
// 				}
// 			}
//
// 			j++;
// 		}
// 	}
//
// 	return res;
// }
//
// for (let i = 1; i < arr.length; i++) {
// 	for (const ss of subseqs(arr, i)) {
// 		if (ss[0] === ss[1]) {
// 			console.log("YES");
// 			proccess.exit(0);
// 		}
// 	}
// }
//
// console.log("NO");
//


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function main() {
    const parameterVariable = readLine();
    const line2 = readLine();

    if(parameterVariable > 2 && parameterVariable % 2 === 0) console.log('YES')
    else console.log('NO')

}


const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let l = 0;
rl.on('line', (input) => {
    rl.close();
    let inp = input.split("")
    let res = ""
    if (inp.length >= 2 && inp.length % 2 === 1) {
        res += inp[Math.floor((inp.length / 2))]
    } else if (inp.length >= 2 && inp.length % 2 === 0) {
        res += inp[Math.floor((inp.length / 2) - 1)]
    }
    let ln = inp.length % 2 === 1 ? inp.length / 2 : inp.length / 2
    ln = Math.floor(ln)
    let inc = inp.length % 2 === 1 ? 0 : 1
    for (let i = 1; i < ln; i++) {
        res += inp[ln + i - inc]
        res += inp[ln - i - inc]
    }
    res += inp[inp.length - 1]
    if (inp.length > 1 && inp.length % 2 == 1) {
        res += inp[0]
    }
    console.log(res)
    return 0;
});


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n');
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr('time : ' + end + 'ms');
  myerr('memory : ' + Math.round(process.memoryUsage().heapTotal / 1024) + 'KB');
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var tmp = nextIntArray();
  var one = tmp[0] * 2 + tmp[1] * 2;
  var two = tmp[0] + tmp[1] + tmp[2];
  var three = tmp[0] * 2 + tmp[2] * 2;
  var four = tmp[1] * 2 + tmp[2] * 2;
  myout(Math.min.apply(null, [one, two, three, four]));
}


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
let stickLength;
let lines=0;
rl.on('line', (input,index) => {
    let res=input.split(" ");

        stickLength=Number(res[0]);

    lines++;
}).on('close', () => {
    getRectangleStick(stickLength);
});

function getRectangleStick(stickLength) {
    if(stickLength<=2000000000 && stickLength%2 === 0){
        if(stickLength%4===0){
            console.log(Math.trunc((stickLength-1)/4));
        }else{
            console.log(Math.trunc(stickLength/4));
        }
    }else{
        console.log(0);
    }
}


function rem(a, b) {
  if (b <= 0) {
    throw Error('divisor must be positive');
  } else {
    const r = (a % b);
    return (r < 0) ? (r + b) : r;
  }
}

function quot(a, b) {
  if (b <= 0) {
    throw Error('divisor must be positive');
  } else {
    const r = rem(a, b);
    const q = ((a - r) / b);
    return q;
  }
}

function ceil(a, b) {
  const r = rem(a, b);
  const q = quot(a, b);
  return (r === 0) ? q : (q + 1);
}

function solve(n, m, a) {
  const x = ceil(n, a);
  const y = ceil(m, a);
  const result = (x * y);
  return result;
}

function main(lines) {
  for (const line of lines) {
    let t = line.trim();
    if (line.length > 0) {
      const [n, m, a] = t.split(/\s+/).map(Number);
      const result = solve(n, m, a);
      console.log(result);
    }
  }
}

async function processLinesFromStream(rs, pf) {
  const content = [];
  rs.setEncoding("utf-8");
  for await (let chunk of rs) {
    content.push(chunk);
  }
  const lines = content.join('').split(/\n/);
  const result = pf(lines);
  return result;
}

processLinesFromStream(process.stdin, main);


const rl = require('readline')
  .createInterface({ input: process.stdin, output: process.stdout })
const write = (...args) => {
  process.stdout.write(args.join(' '));
}

const lines = [];
rl.on('line', line => {
  lines.push(line);
});

rl.on('close', main);
let rli = 0;

function readline() {
    return lines[rli++];
}

function main() {
  const year = parseInt(readline());
  for(let i = 1; ; ++i){
    const numbers = (year+i).toString().split('');
    const set = (new Set())
      .add(numbers[0])
      .add(numbers[1])
      .add(numbers[2])
      .add(numbers[3]);
    if(set.size === numbers.length) {
      write(numbers.join(''));
      break;
    }
  }
}


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', (d) => {
  let [w, h, k] = d.split(' ').map(Number);
  let ans = 0;

  while (k > 0) {
    k--;

    ans += (w * 2) + (h * 2) - 4;
    w -= 4;
    h -= 4;
  }

  console.log(ans);
});


const readline = require("readline");

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

var answer = 0;
var counter = 0;
var check = true;

rl.on("line", input => {

      counter = 0;
    for (var i = 0; i < input.length; i++) {

      if (input[i] == "B") {
        counter++;
      }
    }

    if (counter == 8) {
      answer++;
    }
    else if (check && counter > 0) {
      answer += counter;
      check = false;
    }

}).on("close", () => {
    console.log(answer);
  });


// Polyfill for NodeJS
if (undefined == readline) {
	var rLines = require('fs').readFileSync("/dev/stdin", "utf8").split("\n"),
		rIndex = 0,
		readline = function() {
			rIndex ++
			return rLines[rIndex - 1]
		}
}
if (undefined == print) {
	var print = console.log
}

// Useful Read functions
var int = function() {
	return parseInt(readline())
}

var ints = function() {
	return readline().split(' ')
		.map(function(x) {
			return parseInt(x)
		})
}

// The answer

var ns = ints(),
	a = ns[0],
	b = ns[1]
	i = 0

while (a <= b) {
	a = a * 3
	b = b * 2
	i ++
}

print(i)


'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

// thats all what you have to write to get input from stdin, using readLine.

// Main code runs in main();

function main(){

    let line = readline();
    let distincs = [];
    for (let index = 0; index < line.length; index++) {
        const element = line[index];
        if(distincs.indexOf(element) == -1)
        {
            distincs.push(element);
        }

    }
    if(distincs.length % 2 == 0)
    {
        process.stdout.write("CHAT WITH HER!");
    }else{
    process.stdout.write("IGNORE HIM!");
}

}


let _inputLines;
let _lineNumber = 0;
let inputReader = _inputReader ();

function _main() {

	_inputLines = _inputData.trim().split('\n').map((string) => {
		return string.trim();
	});

	let t = inputReader.readNumber();
	while(t--){
	    let n = inputReader.readNumber();

	    let ans = ((n%10)-1)*10;

	    let temp = n;
	    let i = 1;
	    while(temp > 0) {
	        ans = ans+i;
	        temp = Math.floor(temp/10);
	        i++;
	    }
	    console.log(ans);
	}

}

var _inputData = '';
function cacheInput(data) {
	_inputData += data;
}

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', cacheInput).on('end', _main);

function _inputReader () {
	function readNumber(){
		return Number(_inputLines[_lineNumber++]);
	}

	return {
		readNumber,
	}
}


'use strict';

function solve(a) {
  let cnt = 0;
  for (let i = 0; i < 2; i++) {
    for (let j = 0; j < 2; j++) cnt += a[i][j];
  }
  if (cnt === 0) return 0;
  if (a[0][0] === 1 && a[1][1] && a[0][1] === 1 && a[1][0] === 1) return 2;
  return 1;
}

async function main(read) {
  try {
    let t = Number(await read());
    let res = new Array(t);
    for (let i = 0; i < t; i++) {
      const a = [];
      let tmp = 2;
      while (tmp--) {
        a.push((await read()).split(' ').map(Number));
      }
      res[i] = solve(a);
    }
    return res.join('\n');
  } catch (error) {
    console.log(error);
  }
}

let inputs,
    str = '';
function read() {
  return inputs.next().value.trim();
}
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', input => str += input);
process.stdin.on('end', async () => {
  inputs = str.split('\n').values();
  const output = await main(read);
  process.stdout.write(output);
});


'use strict'

const {EOL} = require('os')

let ipt = ''
process.stdin.on('data', s => ipt += s)
process.stdin.on('end', () => {
  const ils = ipt.split(EOL).slice(0, -1)
  let [n, s, k] = ils[0].split(' ').map(v => parseInt(v))
  let d = ils[1] == 'to head' ? 'l' : 'r'
  let C = ils[2].split('')

  let i = true
  for (let m = 0; m < C.length; m++) {
    let h = C[m]
    if (h == 0) {
      if (s < k && s > 1) s--
      else if (s > k && s < n) s++
    } else { // 1
      i = false
    }

    if (d == 'l') {
      if (k > 1) k--
      else {
        d = 'r'
        k++
      }
    } else { // r
      if (k < n) k++
      else {
        d = 'l'
        k--
      }
    }

    if (h == 1) {
      i = true
      s = d == 'l' ? n : 1
    }

    if (s == k) return console.log('Controller', m + 1)
  }
  console.log('Stowaway')
})


const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

let lineNum = 0;
let countOfData = null;
let data = [];
readline.on('line', line => {
  lineNum++;
  if(lineNum === 1) {
    countOfData = +line;
    return;
  }

  data.push(line);

  if(lineNum - 1 === countOfData) {
    goToSolution(data);
  }

});

function goToSolution(data) {
  data.forEach(num => {
    let count = 0;
    for(let i = 1; i <= 9; i++) {
      let step = '';
      for(let j = 0; j < 4; j++) {
        step += i;
        count += step.length;
        if(num == step) break;
      }
      if(num == step) break;
    }
    console.log(count);
  })
}


let i = '';
process.stdin.on('data', (c) => {
  i += c;
});
process.stdin.on('end', () => {
  const { EOL } = require('os');
  const lines = i.split(EOL);
  const binary = lines[0];
  if (binary === '0') {
    console.log(0);
  } else {
    let count = 0;
    for (let i = 0; i < binary.length; i++) {
      if (binary[i] === '1') {
        count++;
      }
      if (count >= 2) {
        console.log(Math.ceil(binary.length / 2));
        return;
      }
    }
    console.log(Math.ceil((binary.length - 1) / 2));
  }
});


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function readAsInt(){
  return parseInt(readline());
}

function readAsIntList(){
  return readline().split(' ').filter(i => i).map(i => parseInt(i));
}

// Make a Snippet for the code above this and then write your logic in main();

function main() {
  let s = readline();
  let l = s.replace(/[^a-z]+/g,'').length;
  let u = s.replace(/[^A-Z]+/g,'').length;
  console.log((l > u || l === u) ? s.toLowerCase() : s.toUpperCase());
}


const readline = require('readline')

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

rl.on('line', line => {
    solution(line);
});

function solution(name) {
    const charMap = {};
    for (const char of name) {
        if (charMap[char] === undefined) {
            charMap[char] = true;
        }
    }

    if (Object.keys(charMap).length % 2 === 0) {
        console.log('CHAT WITH HER!');
    } else {
        console.log('IGNORE HIM!');
    }
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
/**
6
6 1
100010
6 2
000000
5 1
10101
3 1
001
2 2
00
1 1
0

**/

function gcd(a, b) {
    if (!b) {
        return a;
    }

    return gcd(b, a % b);
};

function main() {
    let n = BigInt(readline());

    // for(let i=0;i<n;i++) {
    //     solve();
    // }

    let currentString = ['c', 'o', 'd', 'e', 'f', 'o', 'r', 'c', 'e', 's'];
    const occur = new Array(10).fill(1n);

    let count = 1n;
    let index = 0;

    while(count < n) {
        count = count / occur[index];
        occur[index]++;
        count = count * occur[index];
        index++;
        if(index === 10) {
            index = 0;
        }
    }

    let string = '';

    for(let i=0;i<currentString.length;i++) {
        string = string + currentString[i].repeat(Number(occur[i]));
    }

    console.log(string);

}

function solve() {
    let [n, m] = readline().split(" ").map(Number);
    let a = readline().split("");

    let count = 0;
    let i = 1;
    if(a.length === 1 && a[0] === "0") {
        console.log(1);
        return;
    }

    while(m > count && i < n) {
        if(i === 1 && a[i-1] === '0' && a[i] === '0') {
            count++;
            a[i-1] = "1";
            continue;
        }

        if(a[i + 1] === n) {
            if(a[i] === "0" && a[i-1] === "0") {
                count++;
            }

            continue;
        }

        if(a[i] === "0" && a[i-1] === "0" && a[i+1] === "0") {
            count++;
            a[i] = "1";
        }

        i++;
    }

    console.log(count);
}


const readline = require('readline')

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
})

let input = []

rl.on('line', line => {
  input = line.split(' ').map(x => parseInt(x))
  const output = solution(input[0])
  console.log(output)
})

rl.on('close', () => {
  // console.log(input)
})

///end of interface

const solution = (n) => {
	let intQuotient = Math.floor(n/5);
	let reminder = n % 5;
	let res = intQuotient + (reminder ? 1 : 0);
	return res;
};


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', (d) => {
  const n = [...d];
  const a = +d;
  const b = +(n.slice(0, n.length - 2).join('') + n.slice(n.length - 1).join(''));
  const c = +(n.slice(0, n.length - 1).join(''));
  const ans = Math.max(a, b, c);

  if (ans === -0) {
    console.log(0);
  }
  else {
    console.log(ans);
  }

});


const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    terminal: false
});

rl.on('line', (d) => {
    let [a, b] = d.split(' ').map(Number);
    let ans = 0;

    while (a <= b) {
        a *= 3;
        b *= 2;
        ans++;
    }

    console.log(ans);
});


const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
  });

  let l=0;
  rl.on('line', (input) => {
      if (l==0) {l++}
      else {
            let b= ""
           rl.close();
           for(let i=0,c=0;i<input.length;c++,i+=c){
            b+=input.charAt(i);
        }
        console.log(b)
    return 0;
}
});


const input = [];

function splbsi(line) {
  return line.split(" ").map((x) => parseInt(x));
}

const readLine = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});

readLine.on("line", (line) => {
  input.push(line);
});

readLine.on("close", () => {
  const str = input[0].toLowerCase();
  let world = 0;
  let find = false;

  for (const char of str.split("")) {
    if (char === "h" && world === 0) {
      world += 1;
    }
    if (char === "e" && world === 1) {
      world += 1;
    }
    if (char === "l" && world >= 2) {
      world += 1;
    }
    if (char === "o" && world >= 4) {
      world += 1;
      find = true;
      break;
    }
  }

  console.log(find ? "YES" : "NO");
});


readline = require('readline')
let stdinInput = '';

// //file
//     var fs = require('fs');
//    const inputfile = '_in.txt';
//    const outputfile = '_out.txt';
//    fs.writeFileSync(outputfile, '');
//    var myInterface = readline.createInterface({
//      input: fs.createReadStream(inputfile),
//    });
//    myInterface.on('line', function (line) {
//       stdinInput += line+'\n';
//     }).on('close', () => {
//            main();
//         process.exit(0);
//     })
   /*
   *  Api Scanner
   */
  class Scanner {
    constructor() {
      this.index = -1;
      this.lines = stdinInput.trim().split('\n'); // eslint-disable-line
    }

    nextLine() {
      this.index += 1;
      return this.lines[this.index].trim();
    }
    nextArray(fn) {
      const array = this.nextLine().split(' ');
      return fn === String ? array : array.map(fn);
    }

    hasNext() {
      return this.index < this.lines.length;
    }
  }

  process.stdin.resume();
  process.stdin.setEncoding('utf-8');
  process.stdin.on('data', (input) => { stdinInput += input; });
  process.stdin.on('end', () => { main(); });

let s;
function main() {
    const is = new Scanner();

    let hello = ['h', 'e', 'l', 'l', 'o'];
    s = is.nextLine();

    let index = 0;
    let check = 0;
    for(let i=0; i<hello.length; i++){
        check = 0;
        for(let j=index; j<s.length; j++){
            if(hello[i]==s[j]){
                index = j+1;
                check=1;
                break;
            }
        }
        if(check==0)
            break;
    }
    if(check==1){
        console.log('YES');
    }else{
        console.log('NO');
    }
}


process.stdin.on('data', input => (input > 2 && input % 2 == 0) ? console.log('YES') : console.log('NO'));


const init = () => {
  process.stdin.resume();
  process.stdin.setEncoding('utf-8');

  let inputString = '';
  let currentLine = 0;

  process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
  });

  process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
      return string.trim();
    });

    main();
  });

  global.readline = () => {
    return inputString[currentLine++];
  }
};

if (typeof readline === 'undefined') {
  init();
}

// Make a Snippet for the code above this and then write your logic in main();

const print = (...args) => {
  console.log(...args);
};

const subtract = (n) => {
  if (n % 10 === 0) return n /= 10;
  return n - 1;
};

const main = () => {
  let [n, k] = readline().split(' ').map(x => parseInt(x));
  while (k--) {
    n = subtract(n);
  }
  print(n);
};


// Sample code to perform I/O:

process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";

process.stdin.on("data", function (input) {
    stdin_input += input;                               // Reading input from STDIN
});

process.stdin.on("end", function () {
    main(stdin_input);
});

/**
 *
 * @param {*} str
 * @param {*} seperator
 */
function splitter(str, seperator = '') {
    return str.trim().split(seperator);
}

/**
 *
 * @param {*} arr
 */
function strToNumArr(arr = []) {
    return arr.map(num => Number(num));
}

/**
 *
 * @param {*} num1
 * @param {*} num2
 */
function matrixArray(num1, num2) {
    return Array(num1).fill(Array(num2));
}

let log = function () {
    return Function.prototype.bind.call(console.log, console, '');
}();

function removeEmptyItem(arr, index) {
    return arr.slice(0, index).concat(arr.slice(index + 1, arr.length));
}

function range(min, max) {

    let arr = [];
    for (let index = min; index < max; index++) {
        arr.push(index);

    }
    return arr;
}

function main(input) {
    let output = nameLookUp(input);
    process.stdout.write(output);       // Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

// Write your code here
function nameLookUp(str) {

    let n = +str.trim();
    let count = 0;
    for (let i = 1; i <= Math.floor(n / 2); i++) {

        if (n % i == 0) {
            count++;
        }
    }
    return count.toString();
}


function main() {
    // write code here:
    var arr = stdin[0].split(' ').map(Number);
    const n = arr.splice(0, 1)[0];
    var v1 = arr[0], v2 = arr[1], t1 = arr[2], t2 = arr[3];
    var second1 = (n - 2) * v1 + (v1 + t1) * 2;
    var second2 = (n - 2) * v2 + (v2 + t2) * 2;
    if (second1 < second2) {
        console.log('First');
    } else if (second1 > second2) {
        console.log('Second');
    } else {
        console.log('Friendship');
    }
}

const readline = require('readline');
const rl = readline.createInterface({input: process.stdin});
var stdin = [];
rl.on('line', function (line) {
    stdin.push(line);
});
rl.on('close', main);


const readLine = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  const n = parseInt(input[0]);
  const nums = input[1].split(' ').map(x => parseInt(x));

  nums.sort((a, b) => a - b);
  console.log(nums.join(' '));
});


const readline = require('readline');

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

var s1, s2, indicator = 0,ans="YES";
rl.on('line', (input) => {
    if (indicator == 0) {
        s1 = input;
        indicator++;
    } else {
        s2=input;
        var s1len = s1.length;
        var s2len = s2.length;
        if (s2len == s1len) {
            for (let i = 0, j = s2len - 1; i < s1len; i++, j--) {
                if(s1[i]!=s2[j]){
                    ans="NO";
                    break;
                }
            }
        }
        else
            ans="NO";
     console.log(ans);
    }

});


const readLine = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout,
});

const input = [];
readLine.on('line', line => input.push(line));
const word = () => {
    let ar = [];
    for (const x of input[0]) {
        ar.push(x);
    }
    let upper = 0;
    let lower = 0;
    for (const y of ar) {
        if (y === y.toUpperCase() ) {
            upper++;
        }
        else {
            lower++;
        }
    }
    console.log(upper > lower ? input[0].toUpperCase() : input[0].toLowerCase());
};

readLine.on('close', word);


/*
* У Давида есть четыре мешка с конфетами. В i-м из них лежит ai
* конфет. Также у Давида есть два друга. Он хочет отдать каждый мешок одному из двух друзей.
* Возможно ли так распределить мешки, чтобы два друга получили одинаковое общее число конфет?
* Обратите внимание, что вы не можете оставить мешки себе или выбросить их,
* каждый мешок должен быть отдан одному из двух друзей.
* Входные данные:
* В первой строке записаны четыре целых числа a1, a2, a3 и a4 (1 ≤ ai ≤ 100) — количества конфет в каждом мешке.
* Пример входных данных: 1 7 11 5
* Выходные данные:
* Выведите YES || NO
*/

let readline = require('readline');
let rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    terminal: false
});

rl.on('line', function(line){
    let candies = [];

    // Сумма элементов массива.
    function sum(arr){
        let sum = 0;
        arr.forEach(function (elem) {
            sum = sum + parseInt(elem);
        });
        if (sum)
            return sum;
        else
            return 0;
    }

    // Преобразуем элементы массива к числу.
    line.split(" ").forEach(function (elem) {
        candies.push(parseInt(elem));
    });

    // console.log(sum(candies), sum(candies)%2);

    // Если число конфет нечётное, задача невыполнима.
    if (!sum(candies) % 2){
        console.log('NO');
        return 'NO';
    }else{
        // Если число конфет чётное, проверяем сумму в мешках 1-3. 72 52 62 62 sum = 248 half = 124
        // 124 - 52 = 72    3 14 36 53 sum 106 half 53 => slice half/
        let half = sum(candies) / 2;

        if (candies.includes(half)) {
            console.log('YES');
            return 'YES';
        }
        let i = 0;
        while( i < candies.length){
            let sum = candies[i];
            for (let j = 0; j < candies.length; j++){
                if (sum === half){
                    console.log('YES');
                    return 'YES';
                } else if (j !== i){
                    sum = sum + candies[j];
                }
                j++;
            }
            i++;
        }
        console.log('NO');
        return 'NO';
    }
});


const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = 1//+lines[l++]
    for (let i = 0; i < t; i++) {
        const n = +lines[l++]
        console.log(solve(n))
    }
// })()
})

function solve(n) {
    let ans = 6
    const base = 4
    // let count = 1
    let prev = 4
    for (let i = 2; i <= n; i++) {
        // base = mul(base, 4)

        // count = count * 2
        // ans = mul(ans, pow(base, count)

        prev = mul(prev, prev)
        ans = mul(ans, prev)
    }
    return ans
}
function add(a, b) {
    return (a + b) % (1e9 + 7)
}
function mul(a, b) {
    let r = 0
    let base = a
    while (b) {
        if (b & 1) {
            r = add(r, base)
        }
        b >>= 1
        base = add(base, base)
    }
    return r
}
function pow(a, b) {
    let r = 1
    let base = a
    while (b) {
        if (b & 1) {
            r = mul(r, base)
        }
        b >>= 1
        base = mul(base, base)
    }
    return r
}


process.stdin.on('data',c=>{a=c.toString().split(' ');console.log(Math.ceil(a[0]/a[2]) * Math.ceil(a[1]/a[2]))})


const readline = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout,
});

const input = [];
readline.on('line', line => { input.push(line); });

readline.on('close', () => {
    const [n, m] = input[0].split(' ').map(Number);
    let min;
    if (n <= m) min = n;
    else min = m;

    if (min % 2 === 1) console.log('Akshat');
    else console.log('Malvika');
});


process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', (inputStd) => {
    inputString += inputStd;
});
process.stdin.on('end', function () {
    inputString = inputString
        .trim()
        .split('\n')
        .map((str) => {
            return str.trim();
        });
    main();
});
function readLine() {
    return inputString[currentLine++];
}
function main() {
    let [n, a, b] = readLine().split(' ').map(Number);
    // let c = n - b;

    let final = n - Math.max(a + 1, n - b) + 1;
    console.log(final);
    // console.log(n - c + 1);
    // if (c === a) {
    //     console.log(n - c);
    // } else {
    //     console.log(n - c + 1);
    // }
    //
    // let start = n - a;
    // let end = n - start + 1;
    // if (end <= b) {
    //     console.log(end);
    // } else if (start === c) {
    //     console.log(n - c);
    // } else {
    //     console.log(n - c + 1);
    // }
}


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

let count = 0;
let n, k;

rl.on('line', (data) => {
  if (count === 0) {
    [n, k] = data.split(' ').map(Number);
  }
  else {
    const p = data.split(' ').map(Number);
    const score = p[k - 1];

    const ans = p.filter(x => x >= score && x != 0);
    console.log(ans.length);
  }

  count++;
});


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
  inputString += inputStdin;
});

process.stdin.on('end', _ => {
  inputString = inputString.trim().split('\n').map(string => {
    return string.trim();
  });

  main();
});

function readline() {
  return inputString[currentLine++];
}

function print(s) {
  process.stdout.write(`${s}`);
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  // input
  const a = readline();
  const set = new Set();

  for (let i = 0; i < a.length; i++) {
    set.add(a.charAt(i));
  }
  // output
  print(set.size % 2 === 0 ? 'CHAT WITH HER!' : 'IGNORE HIM!');
}


const readLine = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  let str = input[0];
  const nums = {};

  for (let i = 0; i < str.length; i += 1) {
    if (str[i] === '4' || str[i] === '7')
      nums[str[i]] === undefined ? nums[str[i]] = 1 : nums[str[i]] += 1;
  }

  const sum = (nums['7'] === undefined ? 0 : nums['7']) + (nums['4'] === undefined ? 0 : nums['4']);
  console.log( (sum === 4 || sum === 7) ? "YES" : "NO" )
});


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (d) => {
  const [w, L, v1, v2] = d.split(' ').map(Number);
  const ans = (L - w) / (v1 + v2);

  console.log(ans.toFixed(6));

  c++;
});


'use strict'

const {EOL} = require('os')

let ipt = ''
process.stdin.on('data', s => ipt += s)
process.stdin.on('end', () => {
  const n = +ipt.split(EOL)[0]

  console.log(n / 2 * 3)
})


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw "ArrayIndexOutOfBoundsException ‚There is no more input";}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt();
  var output = 0;
  var list = new Array(N);
  for(var i = 0; i < N; i++){
    var tmp = nextIntArray();
    list[i] = {
    	home : tmp[0],
      	guest : tmp[1]
    };
  }
  for(var i = 0; i < N; i++){
    for(var j = 0; j < N; j++){
      if(i != j){
        if(list[i].home == list[j].guest){
          output++;
        }
      }
    }
  }
  myout(output);
}


function main() {
    // write code here:
    var arr=stdin[0].split(' ').map(a => Number.parseInt(a)),s;
    s=(arr[0] <=arr[1] && arr[0]<=arr[2]) ? 'Yes' : 'No';
    console.log(s);
}

const readline = require('readline');
const rl = readline.createInterface({input: process.stdin});
var stdin = [];
rl.on('line', function (line) {stdin.push(line);});
rl.on('close', main);


let inputString = "";
let currentLine = 0;
process.stdin.on("data", (data) => {
  inputString += data;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}

// utils
const MOD = 1e9 + 7;
const mod = (n) => ((n % MOD) + MOD) % MOD;
const add = (a, b) => mod(mod(a) + mod(b));
const sub = (a, b) => mod(mod(a) - mod(b));
function mul() {
  for (var a = arguments, r = a[0], i = a.length; --i; )
    r = ((((r >> 16) * a[i]) % MOD) * 65536 + (r & 65535) * a[i]) % MOD;
  return r;
}
function inv(b) {
  for (var a = MOD, u = 0, v = 1, t; b; v = t)
    (t = (a / b) | 0), (a -= t * b), (u -= t * v), (t = a), (a = b), (b = t), (t = u), (u = v);
  u %= MOD;
  return u < 0 ? u + MOD : u;
}
function pow(base, n) {
  if (n === 0) return 1;
  let p = pow(base, Math.floor(n / 2));
  let res = mul(mod(p), mod(p));
  if (n % 2 === 1) res = mul(mod(res), base);
  return res;
}
function highestOneBit(i) {
  i |= i >> 1;
  i |= i >> 2;
  i |= i >> 4;
  i |= i >> 8;
  i |= i >> 16;
  return i - (i >>> 1);
}
function permutation(arr, len, store = "", permutations = []) {
  if (store.length === len) {
    permutations.push(store);
    return;
  }
  for (let i = 0; i < arr.length; i++) {
    const newArr = [...arr];
    const newChar = newArr.splice(i, 1);
    permutation(newArr, len, store.concat(newChar), permutations);
  }
  return permutations;
}

function main() {
  const len = +readLine();
  const str = readLine();
  const [leftPart, rightPart] = [[], []];
  let flag = true;

  for (let i = 0; i < str.length; i++) {
    if (i < len) {
      leftPart.push(+str[i]);
    } else {
      rightPart.push(+str[i]);
    }
  }

  leftPart.sort((a, b) => a - b);
  rightPart.sort((a, b) => a - b);

  if (leftPart[0] < rightPart[0]) {
    for (let i = 0; i < leftPart.length; i++) {
      if (leftPart[i] >= rightPart[i]) {
        flag = false;
        break;
      }
    }
  } else if (leftPart[0] === rightPart[0]) {
    flag = false;
  } else {
    for (let i = 0; i < leftPart.length; i++) {
      if (leftPart[i] <= rightPart[i]) {
        flag = false;
        break;
      }
    }
  }
  if (flag) console.log(`YES`);
  else console.log(`NO`);
}


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let count = 0;

rl.on('line', (d) => {
  if (count === 0) {
    count++;
    return;
  }

  const arr = d.split(' ').map(Number);
  let b = 0;
  let c = 0;

  for (let i = 0; i < arr.length; i++) {
    if (arr[i] < 0) {
      c += arr[i];
    }
    else {
      b += arr[i];
    }
  }

  console.log(b - c);

  count++;
});


'use strict';
// 9- 8- 8- 7- 7- 7- 7- 7- 7-  6- 5- 3- 2- 2- 2 2- 2- 2 1- 1- 1 0- 0-

// 7 4 2  - - - - -
// value = 3
// arr[minIndx] = 4
// min = 1
// 4  - - -

// 9 8 8 7 6 5 4 2 1 0
// 7 7 7 2 1 0
// 7 7 2 2 1
// 1 1
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let arr = []
let input = []
let n;
var readline = require('readline')

process.stdin.on('data', inputStdin => {
    input += inputStdin;
});

process.stdin.on('end', _ => {
    input = input.trim().split('\n').map(string => {
        return string.trim();
    });
    n = input[0]
    arr = input[1].split(" ")
    arr = arr.map(s=>parseInt(s))
    main();
});
function main() {
    // console.log("len",arr.length)
  let visted = {};
  arr.sort(function(a, b){return b-a});
//   arr.reverse();
    //   arr.map(s=>console.log(typeof s))

  function findMinDifference(value) {
    let min = 100000000;
    let minIndex;
    for (let i = 0; i < arr.length; i++) {
      if (visted[i]) continue;
      if (Math.abs(arr[i] - value) < min  ) {
        min = Math.abs(arr[i] - value);
        minIndex = i;
      }
    }
    visted[minIndex] = true;
    return arr[minIndex];
  }
  let pils = 1;
  let boxesCanHold = arr[0]; // 9
  visted[0] = true;

  for (let i = 0; i < arr.length; i++) {
    if (visted[i]) continue;
    if(boxesCanHold ==0){
        boxesCanHold = arr[i];
        visted[i] = true;
        ++pils;
    }
    if(boxesCanHold!=0){
     let nextStrength = findMinDifference(boxesCanHold-1);
     boxesCanHold = nextStrength >= boxesCanHold ? --boxesCanHold : nextStrength;
    }
    if (boxesCanHold == 0 && Object.keys(visted).length != arr.length) {
        // console.log("here")
        i = 0;
    }
    else if(i < arr.length-1 && Object.keys(visted).length != arr.length){
                    i = 0;
    }

  }
  console.log(pils );

}


const readline = require('readline');

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.question('', (answer) => {
    const argumentsArray = answer.split(' ');
    let number = argumentsArray[0];
    const times = argumentsArray[1];

    for(i = 0; i < times; i++){
        if(number % 10 == 0) {
            number /= 10;
        } else {
            number--;
        }
    }

    console.log(number);
    rl.close();
});


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    logic();
});

function readline() {
    return inputString[currentLine++];
}

function output(x) {
    process.stdout.write(x);   // without auto '\n' (newline)
    //console.log(x);  // with auto '\n' (newline)
}

function logic() {
    const line = readline();

    const params = line.split(' ');
    const number = parseInt(params[0]);
    const iterations = parseInt(params[1]);

    let result = number;
    for (let i=1; i <= iterations; i++) {

        if (result % 10) {
            result--;
        }
        else {
            result /= 10;
        }
    }

    output(String(result));
}


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n');
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr('time : ' + end + 'ms');
  myerr('memory : ' + Math.round(process.memoryUsage().heapTotal / 1024) + 'KB');
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var s = next();
  var output = 0;
  var list = "abcdefghijklmnopqrstuvwxyz";
  var index = 0;
  for(var i = 0; i < s.length; i++){
  	var nextIndex = list.indexOf(s[i]);
  	var mae = Math.abs(nextIndex - index);
  	var ato = ((26 - nextIndex) + index);
  	var center = ((26 - index) + nextIndex);
  	output += Math.min.apply(null, [mae, ato, center]);
  	index = nextIndex;
  }
  myout(output);
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.replace(/\s*$/, '')
        .split('\n')
        .map(str => str.replace(/\s*$/, ''));

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function main() {
    let nd = readLine()
        .split(' ')
        .map(value => parseInt(value, 10))

    let a = nd[0];
    let b = nd[1];
    let ans = 0;
    if (a == b) {
        console.log(1);
    } else {
        while (a <= b) {
            ans++;
            a *= 3;
            b *= 2;
        }
        console.log(ans);
    }
}


const readline = require("readline");
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false,
});

let c = 0;
let n, d;

rl.on("line", (data) => {
  if (c === 0) {
    [n, d] = data.split(" ").map(Number);
    c++;
    return;
  }

  const arr = data.split(" ").map(Number);
  const waitTime = (arr.length - 1) * 10;
  const sum = arr.reduce((a, b) => a + b, 0);
  const remmainMinutes = d - sum;

  if (sum + waitTime > d) {
    console.log(-1);
  } else {
    console.log(Math.floor(remmainMinutes / 5));
  }

  c++;
});


const { EOL } = require('os');

let i = '';
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
  let lines = i.split(EOL);

  tester(lines[0]);
});

function tester(num) {
  let strs = String(num);
  let countHappyNumbers = 0;

  for (let i = 0; i < strs.length; i++) {
    let str = strs.charAt(i);

    isHappyNumber(str) && countHappyNumbers++;
  }

  console.log(isHappyNumber(countHappyNumbers) ? 'YES' : 'NO');
}

function isHappyNumber(n) {
  return Number(n) === 4 || Number(n) === 7;
}


let readline = require('readline');
let rl = readline.createInterface({
	input: process.stdin,
	output: process.stdout,
	terminal: false
});

rl.on('line', function(line) {
	DominoPiling(line);

	rl.close();
});

//M N
let DominoPiling = (line) => {
	let input = line.split(' ');
	let M = input[0] * 1;
	let N = input[1] * 1;

	let num1 = M % 2 === 0 ? M / 2 : (M - 1) / 2;
	if (num1 === M / 2) {
		console.log(num1 * N);
	} else {
		console.log(num1 * N + Math.floor(N / 2));
	}
};


const readline = require('readline');

const INPUT = 'test.in';
const LOCAL = process.env.ENABLE_LOCAL_ENV === 'true';
const log = (...args) => {
    LOCAL && console.log(...args)
};
let rl;
let lineNr = 0;

/**
 * MAIN
 */
(async () => {
    const promises = await setup(INPUT);
    await Promise.all(promises);
})();

function setup() {
    const promises = []
    rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout,
        terminal: false,
    });

    rl.on('line', (line) => {
        promises.push(work(line, lineNr));
        lineNr++;
    });

    rl.on('error', (err) => {
        log('Error:', err);
    });

    return new Promise(res => {
        rl.on('close', () => {
            res(promises)
            log('Done!');
        });
    });
}

async function work(line, lineNr) {
    const solutionForLine = await solve(line.trim());
    const responseLine = `${solutionForLine}\n`;
    process.stdout.write(responseLine);
}

/**
 *
 * Solution goes below
 *
 */
function solve(line) {
    const [a, b, c, d] = line.split(' ').map(v => parseInt(v));
    // console.log(a,b,c,d)
    if (isTriangle(a, b, c, d)) return 'TRIANGLE';
    if (isSegment(a, b, c, d)) return 'SEGMENT';
    return 'IMPOSSIBLE';
}

function isTriangle(a, b, c, d) {
    // abc, abd, bcd, acd
    if (a + b > c && a + c > b && b + c > a) return true;
    if (a + b > d && a + d > b && b + d > a) return true;
    if (c + b > d && c + d > b && b + d > c) return true;
    if (c + a > d && c + d > a && a + d > c) return true;
}

function isSegment(a, b, c, d) {
    if (a + b >= c && a + c >= b && b + c >= a) return true;
    if (a + b >= d && a + d >= b && b + d >= a) return true;
    if (c + b >= d && c + d >= b && b + d >= c) return true;
    if (c + a >= d && c + d >= a && a + d >= c) return true;
}


const readline = require('readline');

let secondLine = false;

// Create readline Interface
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let inputs = [];

rl.on('line', lineInput => {
    inputs.push(lineInput);
})

// Read Inputs
rl.on('close', () => {
    inputs = inputs[0].split(' ');
    const n = parseInt(inputs[0]);
    const m = parseInt(inputs[1]);
    let moves = 0;

    if (n < m)
        return console.log(-1)

    moves = Math.floor(n / 2) + n % 2;

    while (moves%m != 0 && moves < n) {
        moves +=1;
    }

    console.log(moves);

});


function ProblemSolver() {
    this.HAS_TEST_CASES = false;
    this.INPUT_FILE_NAME = "test.in";
    this.OUTPUT_FILE_NAME = "out.txt";
    this.DO_OUTPUT_TO_FILE = false;
    this.CLEAR_ARRAY_PER_CASE = false;

    this.solveCase = function() {
        var res , i , j , fl , cn , temp ;
        res = 'YES' ;
        this.s = this.s.toLowerCase() ;
        for( i = 0 ; i < this.n ; i++ ) {
        	this.arr[ this.s.charCodeAt( i ) ]++ ;
        }
        for( i = 'a'.charCodeAt( 0 ) ; i <= 'z'.charCodeAt( 0 ) ; i++ ) {
        	if( this.arr[ i ] == 0 ) {
        		res = 'NO' ;
        		break ;
        	}
        }
        print( res );
    };

    this.init = function() {
        this.lim1 = 100010;
        this.lim2 = 110;
        this.cc = 1;
        this.ind = 1;
        this.n = 0;
        this.cn = 0;
        this.declareAndFillArrays();
    };

    this.getInput = function( irObj ) {
        var hasMoreInput , i;
        hasMoreInput = true;
        try {
            this.n = irObj.nextInt();
            this.s = irObj.nextLine();
        }
        catch( ex ) {
            hasMoreInput = false;
        }
        return hasMoreInput;
    };

    this.clearArraysPerCase = function() {
        var i;
        this.arr = new Array();
        this.adj_list = new Array();
        for( i = 0 ; i < this.lim1 ; i++ ) {
            this.arr.push( 0 );
            this.adj_list.push( new Array() );
        }
    };

    this.clearPerCase = function() {
        this.cn = 0;
        this.cc++;
        if( this.CLEAR_ARRAY_PER_CASE == true ) {
            this.clearArraysPerCase() ;
        }
    };

    this.declareAndFillArrays = function() {
        var i , j;
        this.srr = new Array();
        this.vis = new Array();
        this.arr = new Array();
        this.brr = new Array();
        this.memo = new Array();
        this.done = new Array();
        this.adj_list = new Array();
        for( i = 0 ; i < this.lim1 ; i++ ) {
            this.srr.push( "" );
            this.vis.push( 0 );
            this.arr.push( 0 );
            this.brr.push( 0 );
            this.adj_list.push( new Array() );
        }
        for( i = 0 ; i < this.lim2 ; i++ ) {
            this.memo.push( new Array() );
            this.done.push( new Array() );
            for( j = 0 ; j < this.lim2 ; j++ ) {
                this.memo[ i ].push( -1 );
                this.done[ i ].push( 0 );
            }
        }
    };

    this.init();
}

function InputReader() {
    var self = this ;
    this.allLines = new Array();
    this.currrentLineNumber = 0;
    this.currrentCharacterIndex = 0;
    this.callBackFunction = null ;
    this.parentContext = null ;

    this.readAllLines = function() {
        var singleLine;
        while( true ) {
            try {
                singleLine = readline();
                if( singleLine == null ) {
                    break;
                }
            }
            catch( ex ) {
                break;
            }
            this.allLines.push( singleLine );
        }
    };

    this.readAllLinesFromRhino = function() {
        var brObj , line ;
        importPackage( java.io ) ;
        importPackage( java.lang ) ;
        brObj = new BufferedReader( new InputStreamReader( System[ 'in' ] ) ) ;
        this.allLines = [] ;
        while( true ) {
            line = brObj.readLine() ;
            if( line == null ) {
                break;
            }
            this.allLines.push( line ) ;
        }
    };

    this.readSingleLinesFromNodeJsJudgeServer = function( chunk ) {
        self.chunkData += chunk ;
    };

    this.readEndFromNodeJsJudgeServer = function() {
        self.parseRawData( self.chunkData ) ;
        self.parentContext.runCases() ;
    };

    this.readAllLinesFromNodeJsJudgeServer = function( parentContext ) {
        this.parentContext = parentContext ;
        process.stdin.resume() ;
        process.stdin.setEncoding( 'utf8' ) ;
        this.chunkData = '' ;
        process.stdin.on( 'data' , this.readSingleLinesFromNodeJsJudgeServer ) ;
        process.stdin.on( 'end' , this.readEndFromNodeJsJudgeServer ) ;
    };

    this.parseRawData = function( data ) {
        var len , i , currentString;
        len = data.length;
        currentString = "";
        this.allLines = [] ;
        for( i = 0 ; i < len ; i++ ) {
            if( data[ i ] == '\r' ) {
            }
            else if( data[ i ] == '\n' ) {
                this.allLines.push( currentString );
                currentString = "";
            }
            else {
                currentString += data[ i ];
            }
        }
        if( currentString != "" ) {
            this.allLines.push( currentString );
        }
    };

    this.readAllLinesFromFile = function( inputFileName ) {
        var currentDirectory , fsObj , inputFilePath , rawData;
        fsObj = require( 'fs' );
        currentDirectory = __dirname;
        inputFilePath = currentDirectory + "\\" + inputFileName;
        rawData = fsObj.readFileSync( inputFilePath , "utf8" );
        this.parseRawData( rawData );
    };

    this.next = function( flag ) {
        var len , i , startIdx , res , endIdx;
        if( flag == 0 ) {
        	if( this.currrentCharacterIndex != 0 ) {
        		this.currrentLineNumber++;
            	this.currrentCharacterIndex = 0;
        	}
            res = "";
            len = this.allLines[ this.currrentLineNumber ].length;
            if( typeof( len ) == 'function' ) {
                len = this.allLines[ this.currrentLineNumber ].length() ;
            }
            for( i = this.currrentCharacterIndex ; i < len ; i++ ) {
                res += '' + this.allLines[ this.currrentLineNumber ].charAt( i ) ;
            }
            this.currrentLineNumber++;
            this.currrentCharacterIndex = 0;
            return res;
        }
        while( true ) {
            if( this.currrentLineNumber >= this.allLines.length ) {
                throw new Error( "No more tokens available!" );
            }
            startIdx = -1;
            len = this.allLines[ this.currrentLineNumber ].length;
            if( typeof( len ) == 'function' ) {
                len = this.allLines[ this.currrentLineNumber ].length() ;
            }
            for( i = this.currrentCharacterIndex ; i < len ; i++ ) {
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) != ' '.charCodeAt( 0 ) ) {
                    startIdx = i;
                    break;
                }
            }
            if( startIdx == -1 ) {
                this.currrentLineNumber++;
                this.currrentCharacterIndex = 0;
                continue;
            }
            res = "";
            endIdx = len - 1 ;
            for( i = startIdx ; i < len ; i++ ) {
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) == ' '.charCodeAt( 0 ) ) {
                    endIdx = i;
                    break;
                }
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) >= 48 && this.allLines[ this.currrentLineNumber ].charCodeAt( i ) <= 57 ) {
                    res += '' + ( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) - 48 ) ;
                }
                else {
                    res += '' + this.allLines[ this.currrentLineNumber ].charAt( i );
                }
            }
            this.currrentCharacterIndex = endIdx;
            if( endIdx == len - 1 ) {
                this.currrentLineNumber++;
                this.currrentCharacterIndex = 0;
            }
            return res;
        }
    };

    this.nextInt = function() {
        return parseInt( this.next( 1 ) );
    };

    this.nextDouble = function() {
        return parseFloat( this.next( 1 ) );
    };

    this.nextString = function() {
        return this.next( 1 );
    };

    this.nextLine = function() {
        return this.next( 0 );
    };
}

function FileOutputHandler() {
    this.resultantStringArray = new Array();

    this.addNewLine = function( newString ) {
        this.resultantStringArray.push( newString );
    };

    this.clearPercase = function() {
        this.resultantStringArray = new Array();
    };

    this.flushOutOutputToFile = function( outputFileName ) {
        var i , sz , res , currentDirectory , fsObj , outputFilePath;
        res = "";
        sz = this.resultantStringArray.length;
        for( i = 0 ; i < sz ; i++ ) {
            if( i != 0 ) {
                res += "\n";
            }
            res += this.resultantStringArray[ i ];
        }
        fsObj = require( 'fs' );
        currentDirectory = __dirname;
        outputFilePath = currentDirectory + "\\" + outputFileName;
        fsObj.writeFileSync( outputFilePath , res );
        this.clearPercase();
    };
}

function CodeExecutioner() {
    this.irObj = new InputReader();
    this.psObj = new ProblemSolver();
    this.fohObj = new FileOutputHandler();

    this.runCases = function() {
        if( this.psObj.HAS_TEST_CASES == true ) {
            testCases = this.irObj.nextInt();
            for( i = 0 ; i < testCases ; i++ ) {
                this.psObj.clearPerCase();
                this.psObj.getInput( this.irObj );
                this.psObj.solveCase();
            }
        }
        else {
            while( true ) {
                this.psObj.clearPerCase();
                hasMoreTestCases = this.psObj.getInput( this.irObj );
                if( hasMoreTestCases == false ) {
                    break;
                }
                this.psObj.solveCase();
            }
        }
        if( this.psObj.DO_OUTPUT_TO_FILE == true ) {
            this.fohObj.flushOutOutputToFile( this.psObj.OUTPUT_FILE_NAME );
        }
    };

    this.detectEnvironmentType = function() {
        var environmentType = null ;
        try {
            if( importPackage != null ) {
                environmentType = 'rhino' ;
            }
        }
        catch( ex1 ) {
            try {
                //for nodejs local server check
                if( __dirname != null && readline != null && typeof( readline ) != 'function' ) {
                    environmentType = 'local-node-js' ;
                }
            }
            catch( ex2 ) {
                try {
                    if( readline == null || typeof( readline ) != 'function' ) {
                        environmentType = 'server-node-js' ;
                    }
                    else {
                        environmentType = 'javascript-v8' ;
                    }
                }
                catch( ex3 ) {
                    environmentType = 'server-node-js' ;
                }
            }
        }
        return environmentType ;
    };

    this.configureStreamsAndReadInput = function() {
        var testCases , i , hasMoreTestCases , isLocal , localContext , isNodeJsJudgeServer , environmentType ;
        isNodeJsJudgeServer = false ;
        environmentType = this.detectEnvironmentType() ;
        if( environmentType == 'local-node-js' ) {
            try {
                if( print == null || typeof( print ) != 'function' ) {
                    print = console.log;
                }
            }
            catch( ex ) {
                print = console.log;
            }
            if( this.psObj.DO_OUTPUT_TO_FILE == true ) {
                localContext = this.fohObj;
                print = function() {
                    localContext.addNewLine.apply( localContext , arguments );
                }
            }
            this.irObj.readAllLinesFromFile( this.psObj.INPUT_FILE_NAME );
            this.runCases() ;
        }
        else if( environmentType == 'server-node-js' ) {
            try {
                if( print == null || typeof( print ) != 'function' ) {
                    print = console.log;
                }
            }
            catch( ex ) {
                print = console.log;
            }
            this.irObj.readAllLinesFromNodeJsJudgeServer( this ) ;
        }
        else if( environmentType == 'javascript-v8' ) {
            this.irObj.readAllLines();
            this.runCases() ;
        }
        else if( environmentType == 'rhino' ) {
            this.irObj.readAllLinesFromRhino();
            this.runCases() ;
        }
    };

    this.configureStreamsAndReadInput();
}

new CodeExecutioner();


// NYAN NYAN
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░░░░░▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄░░░░░░░░░
// ░░░░░░░░▄▀░░░░░░░░░░░░▄░░░░░░░▀▄░░░░░░░
// ░░░░░░░░█░░▄░░░░▄░░░░░░░░░░░░░░█░░░░░░░
// ░░░░░░░░█░░░░░░░░░░░░▄█▄▄░░▄░░░█░▄▄▄░░░
// ░▄▄▄▄▄░░█░░░░░░▀░░░░▀█░░▀▄░░░░░█▀▀░██░░
// ░██▄▀██▄█░░░▄░░░░░░░██░░░░▀▀▀▀▀░░░░██░░
// ░░▀██▄▀██░░░░░░░░▀░██▀░░░░░░░░░░░░░▀██░
// ░░░░▀████░▀░░░░▄░░░██░░░▄█░░░░▄░▄█░░██░
// ░░░░░░░▀█░░░░▄░░░░░██░░░░▄░░░▄░░▄░░░██░
// ░░░░░░░▄█▄░░░░░░░░░░░▀▄░░▀▀▀▀▀▀▀▀░░▄▀░░
// ░░░░░░█▀▀█████████▀▀▀▀████████████▀░░░░
// ░░░░░░████▀░░███▀░░░░░░▀███░░▀██▀░░░░░░
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

// 백준의 노드 버전이 너무 낮아 babel 사용.
// 풀이는 solve() 함수에 있음.

const CODEFORCES_NODE = "cf";
const CODEFORCES_V8 = "cf-v8";
const BEAKJOON = "bj";
const TEST = "test";
// var SITE = BEAKJOON;
var SITE = CODEFORCES_NODE;
var DEBUG = false;

if(SITE == BEAKJOON){
  if (!String.prototype.startsWith) {
    String.prototype.startsWith = function(search, pos) {
      return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
    };
  }
  if (!String.prototype.endsWith) {
    String.prototype.endsWith = function(search, this_len) {
      if (this_len === undefined || this_len > this.length) {
        this_len = this.length;
      }
      return this.substring(this_len - search.length, this_len) === search;
    };
  }
  if (!String.prototype.repeat) {
    String.prototype.repeat = function(count) {
      'use strict';
      if (this == null) {
        throw new TypeError('can\'t convert ' + this + ' to object');
      }
      var str = '' + this;
      count = +count;
      if (count != count) {
        count = 0;
      }
      if (count < 0) {
        throw new RangeError('repeat count must be non-negative');
      }
      if (count == Infinity) {
        throw new RangeError('repeat count must be less than infinity');
      }
      count = Math.floor(count);
      if (str.length == 0 || count == 0) {
        return '';
      }
      // Ensuring count is a 31-bit integer allows us to heavily optimize the
      // main part. But anyway, most current (August 2014) browsers can't handle
      // strings 1 << 28 chars or longer, so:
      if (str.length * count >= 1 << 28) {
        throw new RangeError('repeat count must not overflow maximum string size');
      }
      var maxCount = str.length * count;
      count = Math.floor(Math.log(count) / Math.log(2));
      while (count) {
         str += str;
         count--;
      }
      str += str.substring(0, maxCount - str.length);
      return str;
    }
  }
}

String.prototype.replaceAt=function(index, replacement) {
  return this.substr(0, index) + replacement+ this.substr(index + replacement.length);
}

Function.prototype.repeat = function(times){
  for(let i = 0; i < times; i++){
    this();
  }
}

Array.prototype.getMaxConsecutiveSum = function(defaultValue = -Infinity){
  const N = this.length;
  let maxsum = defaultValue;
  let cursum = defaultValue;
  let cur;
  for(var ii = 0; ii < N; ii++){
    cur = this[ii];
    if(cursum + cur > 0){
      if(cur > cursum + cur){
        cursum = cur;
      } else cursum += cur;
    } else {
      cursum = cur;
      if(maxsum < cursum){
        maxsum = cursum;
      }
    }
    if(maxsum < cursum){
      maxsum = cursum;
    }
  }
  this.maxConsecutiveSum = maxsum;
  return maxsum;
}

try {
  require('manakin').global;
  // require ("babel-polyfill");
} catch (error) {

}
try {
  process.argv.forEach(function (val, index, array) {
    if (val.startsWith("site")) {
      switch (val.split("=")[1]) {
        case "test":
          // console.log('change site to test')
          SITE = TEST;
          break;
        case "cf-node":
          // console.log('change site to cf')
          SITE = CODEFORCES_NODE;
          break;
        case "cf":
          // console.log('change site to cf')
          SITE = CODEFORCES_NODE;
          break;
        case "cf-v8":
          // console.log('change site to cf')
          SITE = CODEFORCES_V8;
          break;
        case "bj":
          // console.log('change site to bj')
          SITE = BEAKJOON;
          break;
      }
    }
    if (val.startsWith("debug")) {
      switch (val.split("=")[1]) {
        case "true":
          DEBUG = true;
          break;
        case "false":
          DEBUG = false;
          break;
      }
    }
  });
} catch (error) {
}

let inputFilePath = '';
switch(SITE){
  case TEST:
    const config = require('config');
    var fs = require("fs");
    var path = require('path');
    inputFilePath = config.get('INPUTFILEPATH') || path.resolve(__dirname, "input.txt");
    break;
  default:
    inputFilePath = './input.txt';
    break;
}
const INPUTFILEPATH = inputFilePath;

// if (!String.prototype.endsWith) {
// 	String.prototype.endsWith = function(search, this_len) {
// 		if (this_len === undefined || this_len > this.length) {
// 			this_len = this.length;
// 		}
// 		return this.substring(this_len - search.length, this_len) === search;
// 	};
// }
// if (!Array.prototype.includes) {
//   Array.prototype.includes = function (target) {
//     return this.indexOf(target) !== -1
//   }
// }

const newLine = '\n';
var ans;
var inputText = "";
var lineCount = 0;
var lines;
var input;
var readline;
var getlines;
var lineOpen = false;
var readingLine = '';

var clockStart;
var clock;

var print;
print = console.log;
var it;
var step;
function EnableLogging(){
  it = console.info;
  step = console.success;
}
function DisableLogging(){
  it = function it(params) {
    return 0;
  }
  step = it;
}
if (DEBUG) {
  EnableLogging();
  clock = function(start) {
    if ( !start ) return process.hrtime();
    var end = process.hrtime(start);
    return Math.round((end[0]*1000) + (end[1]/1000000));
  }
} else {
  DisableLogging();
}

// prepares test data. to replace line input, assign arrays to lines variable.
function prepareTestData() {
  // it(lines);

  // lines = ['custom line 1', 'custom line 2'];
}

// executes exactly once for both test and run. execution time will be included to elapsed time.
const prepareSolve = () => {

}

function power(x, y) {    //분할 정복을 이용하여 x^y 구하기
  let ret = 1;
  while (y > 0) {
    if (y % 2) {
        ret *= x;
        ret %= P;
    }
    x *= x;
    x %= P;
    y /= 2;
  }
  return ret;
}

function createArray(lengths) {
  var arr = new Array(lengths || 0),
    i = lengths;
  if (arguments.length > 1) {
    var args = Array.prototype.slice.call(arguments, 1);
    while (i--) arr[lengths - 1 - i] = createArray.apply(this, args);
  }
  return arr;
}

// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ MAIN SOLVE FUNCTION ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

function solve(){
  let [n, k] = readInts();
  while(k > 0){
    if(n % 10 == 0) {
      n /= 10;
    } else n--;
    k--;
  }

  print(n);

}

// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

function resetRead(){
  lineCount = 0;
}

function checkMemoryUsage() {
  it(process.memoryUsage());
}

function readOne(separator=' ') {
  if(lineOpen && readingLine != null){
  // if(lineOpen){
    // it(readingLine);
    let splitPos = readingLine.search(separator)

    let ret = readingLine.slice(0, splitPos);
    if(splitPos == -1){
      // it('close');
      ret = readingLine;
      readingLine = '';
      lineOpen = false;
    }
    readingLine = readingLine.substr(splitPos + 1)
    // it(ret, readingLine, splitPos);
    return ret;
  } else {
    readingLine = readline();
    lineOpen = true;
    if(readingLine == null) return '';
    return readOne(separator);
  }
}

function readInts() {
  try {
    lineOpen = false;
    return readline()
      .split(" ")
      .map(x => parseInt(x));
  } catch (error) {
    console.error(error);
    return null;
  }
}

switch (SITE) {
  case TEST:
    var fs = require("fs");
    var path = require('path');
    // input = fs.createReadStream(path.resolve(__dirname, "input.txt"), {
    //   encoding: "utf8"
    // });
    input = fs.createReadStream(INPUTFILEPATH, {
      encoding: "utf8"
    });

    function inputListener(line) {
      console.log(line);
      if(line.startsWith('end')){
        console.log('end');
        closing();
      }
      if (!line) {
        closing();
      }
      lineCount++;
      inputText += line + "\r\n";
    }

    function readlines() {
      const readline = require("readline");
      const rl = readline.createInterface({
        input,
        output: process.stdout,
        terminal: false
      });
      rl.on("line", inputListener);
      rl.on('close', closing);
    }

    getlines = function* (inputText) {
      var lines = inputText.split(/\r?\n/);
      for (let line of lines) {
        yield line + newLine;
      }
    }

    readline = function () {
      return lines.next().value.trim();
    }

    readlines();

    break;

  case CODEFORCES_NODE:
    input = process.stdin;

    function inputListener(line) {
      if (!line) {
        closing();
      }
      lineCount++;
      inputText += line + "\r\n";
    }

    function readlines() {
      const readline = require("readline");
      const rl = readline.createInterface({
        input,
        output: process.stdout,
        terminal: false
      });
      rl.on("line", inputListener);
      rl.on('close', closing);
    }

    getlines = function* (inputText) {
      var lines = inputText.split(/\r?\n/);
      for (let line of lines) {
        yield line + newLine;
      }
    }

    readline = function () {
      return lines.next().value.trim();
    }

    readlines();

    break;
  case BEAKJOON:
    var fs = require('fs');
    if (DEBUG) {
      // input = fs.readFileSync('./input.txt').toString();
      inputText = fs.readFileSync(INPUTFILEPATH).toString();

    } else {
      inputText = fs.readFileSync('/dev/stdin').toString();
    }

    readline = function () {
      lineCount++;
      let line = lines[lineCount - 1];
      if (line)
        return lines[lineCount - 1].trim();
      else return null;
    }

    getlines = function (inputText) {
      lineCount = 0;
      return inputText.split(/\r?\n/);
    }

    // lines = getlines(input);
    closing();
    break;
  default:
    break;
}

function closing() {
  if(DEBUG){
    DisableLogging();
    const prepareClock = clock();
    lines = getlines(inputText);
    prepareSolve();
    const prepareClockElapsedTime = clock(prepareClock);
    EnableLogging();
    prepareTestData();
    solve();
    resetRead();
    console.warn('performance check');
    DisableLogging();
    clockStart = clock();
    // lines = getlines(inputText);
    solve();
    console.warn(`${clock(clockStart) + prepareClockElapsedTime} ms`);
    EnableLogging();
    process.exit();
  } else {
    lines = getlines(inputText);
    prepareSolve();
    solve();
    process.exit();
  }
}


const readline = require('readline');

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
let input = [];
rl.on('line', (inputString) => {
    let [x, y] = inputString.split(' ').map(v => parseInt(v));
    input = input.concat([x, y]);
    if (input.length == 6) {
        let [w, h, u1, d1, u2, d2] = input;
        for (; h >= 0; h--) {
            w += h;
            if (h == d1) w -= u1;
            if (h == d2) w -= u2;
            w = Math.max(w, 0);
        }
        console.log(w);
        process.exit();
    }
});


process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inp = 0
process.stdin.on("data",input=>{
    inp = input
})
process.stdin.on("end",input=>{
    inp = inp.split(" ")

    main();

})

function main(){

    let ust =  Math.ceil(inp[0]/inp[2])
    let alt = Math.ceil(inp[1]/inp[2])
    let toplam = ust*alt
    console.log(toplam)
}


process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', (inputStd) => {
    inputString += inputStd;
});
process.stdin.on('end', function () {
    inputString = inputString
        .trim()
        .split('\n')
        .map((str) => {
            return str.trim();
        });
    main();
});
function readLine() {
    return inputString[currentLine++];
}

function main() {
    let string = readLine();
    let stringArray = string.split('');
    for (let i = 0; i < stringArray.length; i++) {
        if (stringArray[i] === '+') {
            stringArray.splice(i, 1);
            i--;
        }
    }
    stringArray = stringArray.sort((a, b) => {
        return a - b;
    });
    for (let i = 0; i < stringArray.length - 1; i++) {
        stringArray[i] = stringArray[i] + '+';
    }
    let final = stringArray.join('');
    console.log(final);
}


let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/
    operate(lines);
});

function operate(lines){
    line1=lines[0].split(' ');
    n=line1[0];
    k=line1[1];
    x=0;
    i=0;
    s=1;
    while(s>0){
        i++;
        x+=i;
        m=x-k;
        s=n-m-i;
    }
    console.log(m);
}


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', (str) => {
  console.log(26* (str.length + 1) - str.length);
});


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function readint() {
    let line = readline().split(' ').map(function(num) {
        return parseInt(num);
    });
    return line;
}

function readfloat() {
    let line = readline().split(' ').map(function(num) {
        return parseFloat(num);
    });
    return line;
}

function print(x) {
    console.log(x);
}

function write(x) {
    process.stdout.write(x);
}
function main() {
    let [n] = readint();
    let s = readline();
    s = s.toLocaleLowerCase();
    let alphabet = new Set();
    for(const val of s) {
        alphabet.add(val);
    }
    if(alphabet.size == 26) print("YES")
    else print("NO");
}


let inputString = '';
let currentLine = 0;

const runMain = () => {
  inputString = inputString.trim().split('\n').map(string => string.trim());
  main();
  process.exit();
}
const readLine = () => inputString[currentLine++];

process.stdin.on('data', inputStdin => inputString += inputStdin);
process.stdin.on('end', runMain);
process.on('SIGINT', runMain);

function main() {
  const s = readLine().split('').reverse().join();
  const t = readLine().split('').join();
  console.log(s === t ? 'YES' : 'NO');
}


'use strict';
//const fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.replace(/\s*$/, '')
        .split('\n')
        .map(str => str.replace(/\s*$/, ''));

    main();
});

function readLine() {
    return inputString[currentLine++];
}

// Complete the extraLongFactorials function below.
function extraLongFactorials(n) {
    var ans = [n];
    var num = n;
    for (var i = num - 1; i >= 1; i--) {
        if (num % i === 0) {
        ans.push(i);
        num = i;
        }
    }
    console.log(ans.join(' '));
    return ans;
}
function main() {
   // const ws = fs.createWriteStream(process.env.OUTPUT_PATH);
    const n = parseInt(readLine(), 10);

    const result = extraLongFactorials(n);
   // ws.write(result.join(' ') + '\n');

   // ws.end();
}


let inputString = '';
let currentLine = 0;

const runMain = () => {
  inputString = inputString.trim().split('\n').map(string => string.trim());
  main();
  process.exit();
}
const readLine = () => inputString[currentLine++];

process.stdin.on('data', inputStdin => inputString += inputStdin);
process.stdin.on('end', runMain);
process.on('SIGINT', runMain);

function main() {
  let s = readLine();
  let n = 0;
  s.split('').forEach(el => {
    if (el === el.toUpperCase()) {
      n++;
    }
  });
  if (n > s.length / 2) {
    console.log(s.toUpperCase());
  } else {
    console.log(s.toLocaleLowerCase());
  }
}


var standard_input = process.stdin;

// Set input character encoding.
standard_input.setEncoding('utf-8');

// When user input data and click enter key.
standard_input.on('data', function (s) {
s=s.trim().split('')
    const n = s.reduce((a,c)=>
{
//console.log(a,c);
return a + 9-Number(c)
}
,(1 < s.length || s[0] === '0' ? 1 : 0) + Number(s[0]));
    console.log(n);
});


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
	};
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var one = nextIntArray();
  var h1 = one[1];
  var w1 = one[0];
  var h2 = one[3];
  var w2 = one[2];
  var output = ((h1 + 2) * (w1 + 2) - (h1 * w1)) + ((h2 + 2) * (w2 + 2)  - (h2 * w2));
  myerr(output);
  output -= Math.min(w1 + 2, w2 + 2) * 2;
  myout(output);
}


const readline = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout,
});

readline.question('', (m) => {
    m = m.split(' ').map(Number);
    const ln = m[0];
    const slices = m.slice(1);
    let res = [];
    let x = Math.trunc(ln/slices[0]+1);
    let y = Math.trunc(ln/slices[1]+1);

    for (let i=0; i<=x; i++){
        for (let j=0; j<=y; j++){
            let k = (ln-i*slices[0]-j*slices[1])/slices[2];
            if (Number.isInteger(k) && k>=0)
            {
                res.push(k + i + j);
            }
        }
    }
    res.sort(function(a, b){return b-a});
    console.log(res[0]);
});


process.stdin.resume();
process.stdin.setEncoding("utf-8");
let standardInputString = "";
let currentLine = 0;

function readLine() {
  return standardInputString[currentLine++];
}

process.stdin.on("data", (rawData) => {
  standardInputString += rawData;
});

process.stdin.on("end", (_) => {
  standardInputString = standardInputString
    .trim()
    .split("\n")
    .map((line) => line.trim());

  main();
});

function main() {
  const [m, n, a] = readLine()
    .split(" ")
    .map((e) => parseInt(e));

  console.log(Math.ceil(m / a) * Math.ceil(n / a));
}


var inputs = null;
//inputs = ['8'];
function main(inputs) {
    var w = parseInt(inputs[0]);
    if (w == 2)
        solution('NO');
    for (var i = 2; i < 50; i += 2) {
        if (w % 2 == 0)
            solution('YES');
    }
    solution('NO');
}
///////////////////////////////////////////////////////////////////////////////////////
if (!inputs) {
    var input_1 = '';
    process.stdin.on('data', function (char) { return input_1 += char; });
    process.stdin.on('end', function () {
        var EOL = require('os').EOL;
        var inputs = input_1.split(EOL).slice(0, -1);
        main(inputs);
    });
}
else
    main(inputs);
function solution(data) {
    console.log(data);
    process.exit(0);
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function main() {
    const string = readline().toLowerCase();
    let pointer = 'a';
    let round = 0 ;
    for (let i =0 , c = string.length   ; i < c ; i++) {
        let clockwise =(Math.abs(parseInt(pointer.charCodeAt(0)) - parseInt(string[i].charCodeAt(0))));
        let counterclockwise = Math.abs(26 - clockwise);
        round += (clockwise < counterclockwise) ? clockwise : counterclockwise
        pointer = string[i]
    }
    console.log(round)
}