// 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));
}

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 arr = [];
    let max = [1];
    if (n > 1) {
        for (let index1 = 0; index1 < n; index1++) {
            arr[index1] = [];
            for (let index2 = 0; index2 < n; index2++) {

                if (index1 == 0 || index2 == 0) {
                    arr[index1][index2] = 1;

                }
                else {
                    let indexItem = arr[index1 - 1][index2] + arr[index1][index2 - 1];
                    max.push(indexItem);
                    arr[index1][index2] = indexItem;
                }

            }

        }
    }
    return Math.max(...max).toString();
}


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]);
});


const input = [];

function splitAndParseInt(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 a = parseInt(input[0]);
  const b = parseInt(input[1]);
  const c = parseInt(input[2]);

  console.log(
    Math.max(
      a + b + c,
      a * b * c,
      a * (b + c),
      (a + b) * c,
      a * (c + b),
      (a + b) * c
    )
  );
});


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

let ls = [];

function solve(){
    const len = parseInt(ls[0]);
    for (let i = 1; i <= len; i++){
        console.log(Math.pow(2, parseInt(ls[i])) - 1);
    }
}

rl.on('line', (l) => ls.push(`${l}`));
rl.on('close', () => solve());


// 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();
    // if there is even number then make it half
    // if there is odd number then -(n+1)/2
    let fn = 0;
    if (inputs % 2 === 0) {
        fn = inputs / 2;
    }
    else {
        fn = -(inputs + 1) / 2;
    }
    return fn.toString();
}


const DEBUG = false;
const { EOL } = require('os');
const fs = require('fs');

let r = process.stdin;
if (DEBUG) {
  r = fs.createReadStream('input');
}
let data = '';
r.on('data', c => (data += c));
r.on('end', () => {
  const lines = data.split(EOL);
  let arr = [];
  let d;
  [arr[0], arr[1], arr[2], d] = lines[0].split(' ');
  arr[0] = parseInt(arr[0]);
  arr[1] = parseInt(arr[1]);
  arr[2] = parseInt(arr[2]);
  d = parseInt(d);
  arr = arr.sort(function(a, b) {
    return a - b;
  });
  let res = Math.max(0, d - (arr[1] - arr[0]));
  res += Math.max(0, d - (arr[2] - arr[1]));
  console.log(res);
});


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

readline.on('line', (numbers) => {
  [num1, num2] = numbers.split(' ');
  let result = wrongSubstraction(num1, num2);
  console.log(result);
  readline.close()
})

let wrongSubstraction = (num1, num2) => {
  // revisar en python si vale comprar dos numeros
  if (num1 <= 0 || num2 <= 0) return;

  for(let i = 0; i < num2; i++){
    if(num1%10==0){
      num1 /= 10;
    } else {
      num1 -= 1;
    }
    // console.log(num1);
  }

  return num1;
};


'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(){
    var tests = parseInt(readline());
    for (let t = 0;t < tests; ++t) {
        var nm = readline().split(" ").map(x => parseInt(x));
        var mn = readline().split(" ").map(x => parseInt(x));
        let sum = 0;
        nm.forEach((x)=> {
            sum += x;
        })
        mn.forEach((x)=> {
            sum += x;
        })
        if (sum == 0) {
            console.log(0);
        } else if (sum == 4) {
            console.log(2);
        } else {
            console.log(1);
        }
    }

}


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

rl.on('line', (d) => {
  const n = +d;
  const weeks = Math.floor(n / 7);
  const remainder = n % 7;
  const min = weeks * 2 + Math.max(0, remainder - 5);
  const max = (weeks * 2) + Math.min(2, remainder);

  console.log(min, max);
  c++;
});


//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 one = nextIntArray();
  var n = one[0];
  var k = one[1];
  var ok = 240 - k;
  var output = 0;
  for(var i = 1; i <= n; i++){
    if(i * 5 <= ok){
      ok -= i * 5;
      output++;
    }else{
      break;
    }
  }
  myout(output);
}


let input = [];

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

RL.on('line', (line) => {
    let count_a = 0; [...line].forEach( i => {if(i === 'a') count_a++} );
    if(count_a > line.length - count_a)
        console.log(line.length);
    else
        console.log( line.length - ( line.length-count_a - count_a ) -1)
});

RL.on('close', () => {
});


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

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

process.stdin.on('end', () => {
  arr = arr.split(' ')
  const n = parseInt(arr[0])
  let k = parseInt(arr[1])
  var num = n
  while(k > 0) {
    if(num % 10 == 0) {
      num = num / 10
      k --
    }
    else {
      num--
      k--
    }
  }

  console.log(num)
})


if (process.env.ANT)
{
    global.print = this.print ||
        function(){console.log([...arguments].join(' '))} ||
        require('lol-io').print;
    global.debug = function(){console.log('debug:', [...arguments].join(' '))}
    global.write = this.write || require('lol-io').write
    global.readline = this.readline || require('lol-io').readline
    main();
}
else
{
    const rl = require('readline').createInterface({ input: process.stdin,
        output: process.stdout });
    global.print = console.log
    global.debug = ()=>{};
    global.write = (...args) => {
        process.stdout.write(args.join(' '));
    }
    const lines = []
    rl.on('line', line =>{
        lines.push(line);
    });
    rl.on('close', main)
    let rli = 0;
    global.readline = ()=>lines[rli++];
}

///////////// CODE

function main(){
    let D = [];

    let s = readline();
    let t = readline();

    function test(i, m)
    {
        debug('test ', i, m)
        let is = 0, it = 0;
        if (is==i)
            is += m;
        while (it<t.length)
        {
            while (t[it]!=s[is] && is<s.length)
            {
                is++;
                if (is==i)
                    is += m;
            }
            if (is==s.length)
                return false;
            it++;
            is++;
            if (is==i)
                is += m;
        }
        return it==t.length;
    }

    function check(n){
        debug('check '+n)
        for (let i=0; i<s.length-n+1; i++)
        {
            if (test(i, n))
                return true;
        }
    }

    let l = 1, r = s.length-t.length;
    while (l+1<r)
    {
        let m = (l+r)/2|0;
        if (check(m))
            l = m;
        else
            r = m;
    }
    print(check(r) ? r : r-1);

}


const readline = require('readline');

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

rl.question('', (input) => {
    if (input > 2 && input % 2 === 0) {
        console.log('YES')
    } else {
        console.log('NO')
    }
    rl.close();
});


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=> {
        return line.trim();
    })
    main();
})

function main() {
    let line = '';
    line = readLine().toLowerCase();
    const li = Array.from(line).filter(char=> {
        if(char === 'y' || char === 'o' || char === 'e' || char === 'i' || char === 'a' || char === 'u') {
            return false;
        } else {
            return true;
        }
    })
    console.log(li.map(char=> '.'+char).join(""));
}


function distToCenter(lines) {
    for (var i = 0; i < lines.length; i++) {
        var line = lines[i].split(" ").join("");
        var j = line.indexOf("1");
        if (j !== -1) {
            return Math.abs(j - 2) + Math.abs(i - 2);
        }
    }
}
function main(stdin) {
    console.log(distToCenter(stdin.split("\n")));
}
main(require("fs")
    .readFileSync(0, "utf-8")
    .trim());


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

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

  let ans = '';
  for (let i = 0; i < str.length; i++) {
    if (dir === 'L') {
      ans += seq[(seq.indexOf(str[i]) + 1) % seq.length];
    }
    else {
      ans += seq[(seq.indexOf(str[i]) - 1 + seq.length) % seq.length];
    }
  }

  console.log(ans);

  c++;
});


const readline = require('readline');

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

rl.on('line', (input) => {

   // console.log(`Received: ${input}`);

   var temp = input.split(' ');
   var m = parseInt(temp[0]);
   var n = parseInt(temp[1]);
   var a = parseInt(temp[2]);

   var x = parseInt(m/a) + !!(m%a);
   var y = parseInt(n/a) + !!(n%a);
   var ans;
   if(a>m && a>n )
      ans = 1;
      else ans =x*y
   console.log(ans);
   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();
    });

    main();
});

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

function divideEvenWatermelon(weight) {
    if ((weight < 1 && weight > 100) || (weight % 2 !== 0) || weight === 2) return 'NO';
    return "YES";
}

function main() {
    const x = +(readline());
    console.log(divideEvenWatermelon(x));
}


var run = input => (input.split('').filter(function(item, i, ar){ return ar.indexOf(item) === i; }).join('').length % 2 == 0) ? 'CHAT WITH HER!' : 'IGNORE HIM!';

process.stdin.setEncoding('utf8');

process.stdin.on('readable', () => {
    let input = process.stdin.read();
    input = input.trim();

    if (input !== null && typeof input != 'number') {
        process.stdout.write(run(input) + '\n');
    }

    process.exit(0);

});


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

let currentLine = 0;
let inputString = "";

process.stdin.on("data", (raw_data) => {
  inputString += raw_data;
});

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

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

/******** Main function*************/

function main() {
  var n = +readLine();
  var m = readLine().split(" ").map(Number);

  m.sort((a, b) => a - b);
  console.log(m.join(" "));
}


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

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

  if (c === 1) {
    str2 = d;
    c++;
    return;
  }

  str3 = d;

  if (str1 === [...str3].reverse().join('') && str2 === [...str2].reverse().join('')) {
    console.log('YES');
  }
  else {
    console.log('NO');
  }

  c++;
});


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

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

  const [x, y] = d.split(' ').map(Number);
  a.push(x);
  b.push(y);

  c++;
});

rl.on('close', () => {
  let ans = 0;

  for (let i = 0; i < a.length; i++) {
    for (let j = 0; j < b.length; j++) {
      if (a[i] === b[j]) {
        ans++;
      }
    }
  }

  console.log(ans);
});


const readline = require('readline');

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

rl.question('', (answer) => {
    if (answer % 2 === 0 && answer != 2) {
        console.log('YES')
    } else {
        console.log('NO')
    }
    rl.close()
})


const readline=require('readline');
const rd=readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
rd.question('', (s)=>{
    s=s.replace(new RegExp('WUB', 'g'), ' ');
    console.log(s);
    rd.close();
})


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

let l = 0;
rl.on('line', (input) => {
        rl.close();
        let numbers = input.split(' ').map(x=>parseInt(x))
        console.log(Math.min(Math.min(numbers[0]+2,numbers[1]+1),numbers[2])*3-3)
});


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 [Numberofstudents, initialCandyValue] = readLine()
        .split(' ')
        .map(Number);
    // let home = [];
    // let more = [];

    let students = readLine().split(' ').map(Number); // [1 3 1 4 2]
    // for (let i = 0; i < students.length; i++) {
    //     if (students[i] <= initialCandyValue) {
    //         let t = students[i];
    //         home[t] = i;
    //     } else {
    //         let test = students[i];
    //         more[test] = i;
    //     }
    // }
    // let highest = 0;
    // let vagfol = 0;
    // if (more.length !== 0) {
    //     for (let i = 0; i < more.length; i++) {
    //         // if (more[i] > highest) {
    //         //     highest = more[i];
    //         // }
    //         let iThVagfol = Math.ceil(more[i] / initialCandyValue);
    //         if (iThVagfol > vagfol) {
    //             vagfol = iThVagfol;
    //         } else if (vagfol === iThVagfol) {
    //             highest = more[i];
    //         }
    //     }
    // } else if (more.length === 0) {
    //     for (let i = 0; i < home.length; i++) {
    //         if (home[i] > highest) {
    //             highest = home[i];
    //         }
    //     }
    // }

    let highest = 0;
    let vagfol = 0;
    // if (more.length !== 0) {
    for (let i = 0; i < students.length; i++) {
        // if (more[i] > highest) {
        //     highest = more[i];
        // }
        let iThVagfol = Math.ceil(students[i] / initialCandyValue); //100
        if (iThVagfol > vagfol) {
            vagfol = iThVagfol;
            highest = students.lastIndexOf(students[i]);
        } else if (vagfol === iThVagfol) {
            highest = students.lastIndexOf(students[i]);
        }
    }
    console.log(highest + 1);
    // console.log(Math.max.apply(null, more));
}


"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++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  const x = readline();
 const y = readline();

  colorfulStones(x,y);
}

function colorfulStones(rocks, instructions) {
  let rockPointer = 0;

  for (const instruction of instructions) {
    if (instruction === rocks[rockPointer]) rockPointer++;
  }
  console.log(rockPointer + 1);

  return rockPointer + 1;
}


process.stdin.resume();
process.stdin.setEncoding('utf8');
let input= '', readline, cout;
process.stdin.on('data', (chunk) => input+=chunk);
process.stdin.on('end', () => {
    input = input.split('\n');
    cout = (data) => process.stdout.write(data+'\n');
    var inputLineIndex = 0;
    readline = function(){return inputLineIndex>=input.length?undefined:input[inputLineIndex++]};
    process.exit(main() || 0);
});

function main(){
    let a = readline();
    if(a > 2 && a % 2 === 0) console.log("YES");
    else console.log("NO")
    return 0;
}


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

rl.on('line', (line) => {
    let result = "";
    for (let i = 0; i < line.length; i++) {
        const char = line[i];

        if (isVowel(char)) {
            continue;
        } else {
            result += "." + char.toLowerCase()
        }
    }

    console.log(result);
});

const vowels = ["a", "o", "y", "e", "u", "i"];
function isVowel(c) {
    if (vowels.includes(c.toLowerCase())) {
        return true;
    } else {
        return false;
    }
}


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

// single line input
readline.on('line', line => {
  readline.close(), console.log(parseInt(line) % 2 === 0 && parseInt(line) > 2 ? "YES" : "NO");
});


process.stdin.setEncoding('utf8');
let input = [];
process.stdin.on('readable', () => {
    const chunk = process.stdin.read();
    if (chunk !== null) {
        let re = /\n\s*| /;
        input = chunk.split(re).slice(0, -1);
        let myinput = input.map(value => parseInt(value));
        console.log(snowball.apply(null, myinput));
        process.exit(0);
    }
});

function snowball(weight, height, u1, d1, u2, d2) {
    let w = weight, h = height;
    for (; h >= 0; h--) {
        w += h;
        if (h == d1) w = (w - u1) > 0 ? (w - u1) : 0;
        if (h == d2) w = (w - u2) > 0 ? (w - u2) : 0;
    }
    return w;
}


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 number = parseInt(readLine());
    // let number = parseInt(numberString);
    // let n = numberString.length;
    // let result = (2 * (Math.pow(2, n) - 1)) / (2 - 1);
    // if (numberString[n - 1] === '4') {
    //     result = result - 1;
    // }
    // let count = 0;
    // for (let i = 4; i <= number; i++) {
    //     let iThstring = i.toString();
    //     // console.log(iThstring);
    //     if (
    //         iThstring.includes('1') ||
    //         iThstring.includes('2') ||
    //         iThstring.includes('3') ||
    //         iThstring.includes('5') ||
    //         iThstring.includes('6') ||
    //         iThstring.includes('8') ||
    //         iThstring.includes('9') ||
    //         iThstring.includes('0')
    //     ) {
    //         continue;
    //         // console.log(i);
    //         // count++;
    //     } else {
    //         count++;
    //     }
    // }
    // console.log(count);
    let limit = 1000000000;
    let luckydigits = [];
    function generate(curr) {
        if (curr > limit) return;
        // if (curr) {
        luckydigits.push(curr);
        // }
        curr = curr * 10;
        generate(curr + 4);
        generate(curr + 7);
    }
    generate(0);
    delete luckydigits[0];
    luckydigits.sort((a, b) => {
        return a - b;
    });
    // generate(7);
    console.log(luckydigits.indexOf(number) + 1);
}


process.stdin.addListener("data", (data)=>{
    var n = parseInt(data.toString().trim());
    if (n > 2 && n % 2 == 0) process.stdout.write("YES");
    else process.stdout.write("NO");
    process.exit();
})


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

rl.on('line', (d) => {
  let ans = 0;
  let v = +d;
  let amount = [100, 20, 10, 5, 1];

  let idx = 0;
  while (v > 0) {
    while (v >= amount[idx]) {
      ans++;
      v -= amount[idx];
    }

    idx++;
  }

  console.log(ans);
});


var readline = require('readline');

var input = [];

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

var i = 0;

rl.on('line', function(cmd) {
    input.push(cmd);

    i++;
    if (i == 2) {
        rl.close();
    }
});

rl.on('close', function(cmd) {
    var n = parseInt(input[0]);
    var arr = input[1].split(' ').map(Number);

    var max = arrayMax(arr);
    var min = arrayMin(arr);

    var startIndex = 0;
    var endIndex = 0;

    var startCounting = false;

    for (var i = 0; i < n; i++) {
        if ((arr[i] == max || arr[i] == min) && !startCounting) {
            startCounting = true;
            startIndex = i;
            i++;
        }
        if ((arr[i] == max || arr[i] == min) && startCounting) {

            startCounting = false;
            endIndex = i;
            break;
        }
    }

    var maxarr = [];
    maxarr.push(endIndex - startIndex);
    maxarr.push(endIndex);
    maxarr.push(startIndex);
    maxarr.push(arr.length - 1 - startIndex);
    maxarr.push(arr.length - 1 - endIndex);

    function arrayMin(array) {
        var len = array.length,
            min = Infinity;
        while (len--) {
            if (array[len] < min) {
                min = array[len];
            }
        }
        return min;
    };

    function arrayMax(array) {
        var len = array.length,
            max = -Infinity;
        while (len--) {
            if (array[len] > max) {
                max = array[len];
            }
        }
        return max;
    };

    console.log(arrayMax(maxarr));
    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++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  const x = readline();

  nightAtMuseum(x);
}

function nightAtMuseum(name) {
  let rotationCount = 0;
  let fixedPointer = "a";

  var alphabet = [
    "a",
    "b",
    "c",
    "d",
    "e",
    "f",
    "g",
    "h",
    "i",
    "j",
    "k",
    "l",
    "m",
    "n",
    "o",
    "p",
    "q",
    "r",
    "s",
    "t",
    "u",
    "v",
    "w",
    "x",
    "y",
    "z",
  ];

  for (let i = 0; i < name.length; i++) {
    let char = name[i];
    let pointerIndex = alphabet.indexOf(fixedPointer);
    let charIndex = alphabet.indexOf(char);

    rotationCount += Math.min(
      Math.abs(pointerIndex - charIndex),
      Math.min(pointerIndex, charIndex) -
        0 +
        (26 - Math.max(pointerIndex, charIndex))
    );

    fixedPointer = char;
  }
  console.log(rotationCount);

  return rotationCount;
}


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.num = function() {
		return Number(this.next().value);
	};
nl.nums = function() {
		return this.next().value.split(/\s/g).map(Number);
	};
nl.line = function() {
		return this.next().value;
	}

const sol = () => {
	let str = nl.line();
	let s = str.split('');
	s.sort();
	let result = s.filter(x => x === s[s.length - 1]).join('');
	console.log(result);

};

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


// Input
'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++];
}

//main
function main() {
    var n = parseInt(readline());
    console.log((n<=2 || n%2) ? "NO" : "YES");
}


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

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

  const arr = d.split(' ').map(Number);

  let idx = arr.length - 1;

  while (k > 0) {
    arr[idx] = x;
    idx--;
    k--;
  }

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

  console.log(ans);

  c++;
});


/**
 * Author : Fazlul Hoque
 * Node.js version : 12.16.3
 * command : node fileName.js <input.txt >output.txt
 */
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = ""; //An array of  raw inputs (includes 'n,\r , not usable. need to process before use)
let currentLine = 0; //input sequence controller variable.

process.stdin.on("data", (inputStdin) => {
    inputString += inputStdin;
});
process.stdin.on("end", () => {
    inputString = inputString.split("\n");
    main(); // after input
});

/********** Utility Functions Start **********/
/**
 *  read row Input
 * @returns string
 */
function _readRawLine() {
    return inputString[currentLine++];
}
function readLine(){
    // return _readRawLine().replace(/\s+$/g, '');
    return _readRawLine().replace('\r', '');
}

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

function readSingleInt() {
    const p = readLine();
    return parseInt(p);
}

function readIntArray() {
    return readLine().split(" ").map((v) => parseInt(v));
}

function readArray() {
    return readLine().split(" ");
}

function int(n) {
    return parseInt(n);
}
/********** Utility Functions End **********/
/**
 * Don't Touch this fucntion at all , unless you know what are you doing!
 */
function main() {
    solve();
}

// ********** actual Code Starts from here **********

function solve() {
    let t = readSingleInt();
    while(t--){
        let n = readSingleInt();
        let p = n,k=1;
        while(n--){
            k=k<<1;
        }
        console.log(k-1)
    }
}


function main() {
    // write code here:
    var num=Number(stdin[0]),n;
    var a=num%100,b=a%20,c=b%10,d=c%5;
    n=Math.floor(num/100)+Math.floor(a/20)+Math.floor(b/10)+Math.floor(c/5)+Math.floor(d/1);
    console.log(n);
}

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);


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

let inputString = '';

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

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

    main(inputString);
});

function log(message){
    if(process.env.NODE_ENV === "debug"){
        console.log(message);
    }
}

function main(fileContents) {//input lines as an array
    // console.log(fileContents);
    fileContents.splice(0,1);
    fileContents.forEach(num => {
        num = parseInt(num);

        let maxSquare = 0
        let squareCurrent = 0

        let maxCube = 0
        let cubeCurrent = 0

        const magicNumbers = new Set();

        while(maxSquare < num){
            squareCurrent++
            maxSquare = Math.pow(squareCurrent,2)

            if(maxSquare > 0 && maxSquare <= num)
            magicNumbers.add(maxSquare)
        }

        while(maxCube < num){
            cubeCurrent++
            maxCube = Math.pow(cubeCurrent,3)

            if(maxCube > 0  && maxCube <= num)
            magicNumbers.add(maxCube)
        }

        // if(magicNumbers.size < 20){
        //     console.log(magicNumbers)
        // }

        console.log(magicNumbers.size)
    })
}


"use strict";
var input = '';
var inputResolve;
var inputPromise = new Promise(resolve => inputResolve = resolve);
process.stdin.on('data', c => input += c);
process.stdin.on('end', () => {
    inputResolve();
});
(async () => {
    // var time = Date.now();
    await inputPromise;
    var inputs = input.split(/\r?\n/);
    var n = +inputs[0];
    var s = 0;
    for (let i = 1; i <= 1024; i++) {
        if (+i.toString(2) <= n)
            s++;
    }
    console.log(s);
})();


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 k = parseInt(readLine());
    let months = readLine().split(' ').map(Number);
    months.sort((a, b) => b - a);
    if (k === 0) {
        console.log(0);
        return;
    }
    let count = 0;
    let sum = 0;
    for (let i = 0; i < months.length; i++) {
        sum = sum + months[i];
        count++;
        if (sum >= k) {
            break;
        }
    }
    if (sum < k) {
        console.log(-1);
        return;
    }
    console.log(count);
}


const readline = require('readline');

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

rl.on("line", (line) => {
    var n = parseInt(line);
    console.log( n > 2 && n % 2 == 0 ? "YES" : "NO" );
    rl.close();
});


let data = '';
process.stdin.on('data', c => data += c);
const sol = () => {
    let lines = data.split(/\n/g);
    let words = lines[1].split(/\s/g);
    let m = 0;
    words.forEach(w => {
        let c = 0;
        for(let e of w) {
            if (e >= 'A' && e <= 'Z') {
                c++;
            }
        }
        if (c > m) {
            m = c;
        }
    });
    console.log(m);
};
process.stdin.on('end', sol);


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++];
}
function main() {
  const [n, m] = readLine()
    .split(" ")
    .map((n) => parseInt(n));
  if (!isPrime(m)) {
    console.log("NO");
    return;
  } else {
    for (let i = m - 1; i > n; i--) {
      if (isPrime(i)) {
        console.log("NO");
        return;
      }
    }
    console.log("YES");
  }
}

function isPrime(num) {
  const n = Math.floor(Math.sqrt(num));
  for (let i = 2; i <= n; i++) {
    if (num % i === 0) return false;
  }
  return num === 1 ? false : true;
}


//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;
  for(var i = 1; i < N; i++){
    if((N - i) % i == 0){
      output++;
    }
  }
  myout(output);
}


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

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

  const arr = d.split(' ');
  const obj = {};
  const ans = [];

  for (let i = arr.length - 1; i >= 0; i--) {
    if (!obj[arr[i]]) {
      obj[arr[i]] = true;
      ans.push(arr[i]);
    }
  }

  console.log(ans.length);
  console.log(ans.reverse().join(' '));

  c++;
});


process.stdin.resume();
process.stdin.setEncoding('ascii');

var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;

process.stdin.on('data', function (data) {
    input_stdin += data;
});

process.stdin.on('end', function () {
    input_stdin_array = input_stdin.split("\n");
    main();
});

function readLine() {
    return input_stdin_array[input_currentline++];
}

function solveMeFirst(a) {
  // Hint: Type return a+b below
  return a > 2 && a % 2 === 0 ? "YES" : "NO";
}

function main() {
    var a = parseInt(readLine());

    var res = solveMeFirst(a);
    console.log(res);
}


const readline = require('readline');
const rl = readline.createInterface({input: process.stdin});
let input = [];
rl.on('line', function (line) {input.push(line);});
rl.on('close', function() {
    input.forEach((row, index) => {
        input[index] = row.split(' ').map(i => Number(i));
    })

    let matrix = [[1,1,1], [1,1,1], [1,1,1]];

    for(let i = 0; i < input.length; i++) {
        for(let j = 0; j < input[i].length; j++) {
            if (input[i][j] != 0) {
                for (let n = 0; n < input[i][j]; n++) {
                    matrix[i][j] = (matrix[i][j]) ? 0 : 1;

                    // top
                    if (matrix[i-1]) matrix[i-1][j] = (matrix[i-1][j]) ? 0 : 1;
                    // bottom
                    if (matrix[i+1]) matrix[i+1][j] = (matrix[i+1][j]) ? 0 : 1;

                    // left
                    if (matrix[j-1]) matrix[i][j-1] = (matrix[i][j-1]) ? 0 : 1;
                    // right
                    if (matrix[j+1]) matrix[i][j+1] = (matrix[i][j+1]) ? 0 : 1;
                }
            }
        }
    }

    let result = ''
    matrix.forEach((row) => result += row.join('') + '\n');

    console.log(result);

});


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

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

  while (s / n > 0) {
    if (s >= n) {
      ans += Math.floor(s / n);
      s = s % n;
    }
    else {
      n = s;
    }
  }

  console.log(ans);
});


const readline = require("readline");

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

function GCD(a,b)
{
    if (b===0) return a;

    return GCD (b, a%b);
}

var counter = 0;
var n = 0;

rl.on("line", input => {
  n = parseInt(input);
  for (var i = 2; i < n; i++) {
    var item = n;
    while (n != 0) {
      counter += n % i;
      n = parseInt(n / i);
    }
    n = item;
  }

  var temp = GCD(counter,n-2)

  console.log(counter/temp + "/" + (n - 2)/temp);
  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();
    });
    main();
});

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

function main() {
    const inputs = readline().split(" ");
    const output = Math.ceil(inputs[0]/inputs[2])*Math.ceil(inputs[1]/inputs[2]);
    console.log(output);
}


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], input[1])
  console.log(output)
})

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

///end of interface

var solution = function(n, k){
  res = n;
  var getLastDigit = function(d){
    last = d%10;
    return +last;
  };

  for (i = 0; i < k; i++){
    var lastDigit = getLastDigit(res);
    //if the last digit of the number is non-zero, she decreases the number by one;
    // the last digit of the number is zero, she divides the number by 10 (i.e. removes the last digit).
    if (lastDigit !== 0) {
      res--;
    } else {
      res = res/10;
    }
  }
  return res;
}


const readLine = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});
const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  const desk = input[1];
  let answer = 0;

  if (desk.length < 2) { console.log(0); process.exit(); }

  for (let i = 1; i < desk.length; i += 1) {
    if (desk[i] === desk[i-1]) answer += 1;
  }

  console.log(answer);
});


"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
function iInpArr() {
  return readline()
    .trim()
    .split(" ")
    .map((cur) => parseInt(cur));
}
function BInpArr() {
  return readline()
    .trim()
    .split(" ")
    .map((cur) => BigInt(cur));
}
function string() {
  return readline().trim();
}
function stringArr() {
  return readline().trim().split("");
}

function stringArr1() {
  return readline().trim().split(" ");
}
function getValue() {
  return parseInt(readline());
}
function iInpArr1() {
  return readline()
    .trim()
    .split("")
    .map((cur) => parseInt(cur));
}
let mod = 1e9 + 7;
mod = BigInt(mod);
const pow = (num, exp, mod) => {
  if (exp === BigInt(0)) return BigInt(1);
  let x = pow(num, exp / BigInt(2), mod);
  if (exp % BigInt(2)) return (((x * x) % mod) * num) % mod;
  else return (x * x) % mod;
};
const inverse = (num, exp) => {
  return pow(BigInt(num), BigInt(exp), BigInt(mod));
};
const sqrt = (n) => {
  let low = 1n,
    high = n,
    ans;
  while (low <= high) {
    let mid = (low + high) / 2n;
    if (mid * mid <= n) {
      ans = mid;
      low = mid + 1n;
    } else high = mid - 1n;
  }
  return ans;
};

const solve = () => {
  let t = 1;
  while (t--) {
    let n = getValue();
    let ans = 6n,
      k = 4n;
    for (let i = 2; i <= n; i++) {
      ans = (ans * ((k * k) % mod)) % mod;
      k = (k * k) % mod;
    }
    console.log(ans + "");
  }
};
solve();


const readline = require('readline');

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

rl.on('line', function(line){
    const sp = line.split(' ');
    let lcw = parseInt(sp[0]);
    let bcw = parseInt(sp[1]);
    let y = 0;

    while (true) {
        y++;
        lcw *= 3;
        bcw *= 2;

        if (lcw > bcw) {
            break;
        }
    }

    console.log(y);
});


process.stdin.resume();
process.stdin.setEncoding('utf8');

let input = [], readline, print;

process.stdin.on('data', chunk => {
  input.push(chunk);
});

process.stdin.on('end', () => {
  print = data => {process.stdout.write(data+'\n')};
  let inputLineIndex = 0;
  readline = () => {
    return inputLineIndex >= input.length && undefined || input[inputLineIndex++]
  };
  process.exit(main() || 0);
});

function main()
{
  let n = readline().split(' ');
  print(Math.ceil(n[0] / n[2]) * Math.ceil(n[1] / n[2]));
  return 0;
}


var readline = require('readline');

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

let result = 0;

const check = (n, m, a) => {
  const x = Math.ceil(n / a);
  const y = Math.ceil(m / a);
  return x * y;
};

rl.on('line', function (data) {
    const input = data.split(' ');
    const n = Number(input[0]);
    const m = Number(input[1]);
    const a = Number(input[2]);

    result = check(n, m, a);
});

process.stdin.on('end', () => { console.log(result); process.exit(0); });


// 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(arr) {
    let nLines = arr.trim().split(' ');
    let matrix = nLines.reduce((acc,row)=>{
       return acc * Number(row);
    },1);
    let totalOutput = Math.floor(matrix/2);
    return totalOutput.toString();

}


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

rl.on('line', (d) => {
  let ans = 0;
  let n = +d;

  for (let i = 1; i <= n / 2; i++) {
    if (n % i === 0) {
      ans++;
    }
  }
  console.log(ans);
});


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 =>{
    return line.trim();
  });

  main();
})

function main(){

  //first line in input
  let [n] = readLine().split(' ').map(Number);

  let line = readLine().split('');
  let prev = 0;

  let result = '';
  for(let i = 0; i<line.length; i++){
    let counter = 0;
    for(let j  =0; j<line.length; j++){
      if(line[i] === line[j] && line[i+1] === line[j+1]){
        counter++;
      }
    }
    if(counter > prev){
      prev = counter;
      result = line[i] + line[i+1];
    }
  }
  console.log(result);

}


const readline = require('readline');

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

function check(s) {
    let sLen = s.length;
    if (sLen == 0 || sLen > 16)
        return false;

    for (let i = 0; i < sLen; i++) {
        if (!(s[i] >= 'a' && s[i] <= 'z' ||
            s[i] >= 'A' && s[i] <= 'Z' ||
            s[i] >= '0' && s[i] <= '9' ||
            s[i] == '_')) return false;
    }

    return true;
}

function checkHost(hostName) {
    let hostLen = hostName.length;
    if (hostLen == 0 || hostLen > 32)
        return false;
    var tokens = hostName.split('.');
    for (let i = 0; i < tokens.length; i++)
        if (!check(tokens[i])) return false;

    return true;
}

var isUser = false, ishost = false, isResource = false;
rl.on('line', (input) => {

    let atIndx = input.indexOf('@');
    if (atIndx != -1) {
        let userName = input.substring(0, atIndx);
        isUser = check(userName);
        let slashIndx = input.indexOf('/');
        let hostName = (slashIndx != -1) ? input.substring(atIndx + 1, slashIndx) : input.substring(atIndx+1);
        ishost = checkHost(hostName);

        if (slashIndx == -1) isResource = true;
        else {
            let resource = input.substring(slashIndx + 1);
            isResource = check(resource);
        }

    }

    //console.log("isUser=%s  isHost=%s   isResource=%s",isUser,ishost,isResource);
    console.log((isUser && ishost && isResource) ? "YES" : "NO");
    rl.close();
});


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();
    while (string.includes('WUB')) {
        string = string.replace('WUB', ' ');
    }
    let stringArray = string.split(' ');
    // console.log(stringArray);
    // stringArray.forEach((item) => {
    //     if (item === '') {
    //         delete item;
    //     }
    // });
    for (let i = 0; i < stringArray.length; i++) {
        if (stringArray[i] === '') {
            // stringArray.length--;
            delete stringArray[i];
        }
    }
    let filter = stringArray.filter(Boolean);
    console.log(filter.join(' '));
}


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 arr = readLine()
    .split(" ")
    .map((n) => parseInt(n));

  const sum = arr.reduce((total, num) => total + num, 0);
  let found = false;

  if (len === 2 && arr[0] === arr[1]) {
    console.log("YES");
    found = true;
  }

  for (let i = 0; i < len; i++) {
    if (found) break;
    let total = 0;
    for (let j = 0; j < len - 2; j++) {
      const index = (i + j) % len;
      const nextIndex = (index + 1) % len;
      total += arr[index] + arr[nextIndex];
      if (total === sum - total) {
        found = true;
        console.log("YES");
        break;
      }
    }
  }
  !found && console.log("NO");
}


// https://codeforces.com/problemset/problem/977/B
// Big O:
// Time complexity:
// Space complexity:

const readline = require("readline");

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

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] + 1 : 1;
        if (occurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = occurrences;
        }

        gramOccurrences[twogram] = occurrences;
    }

    return mostCommonGram;
}


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 a = readLine().split('+').map(num => Number(num)).sort((a, b) => a - b).join('+');
  console.log(a);
}


let stdin = process.stdin;
stdin.setEncoding('utf8');
stdin.on('data', function (data) {
    let input = data.split('\n');
    let n = input[0];
    let k = input[1];
    let result = solution(n, k);
    console.log(result);
});

// End of interface

const solution = (cardOnTable, cardsInHand) => {
  if (cardsInHand.indexOf(cardOnTable[0]) >= 0 || cardsInHand.indexOf(cardOnTable[1]) >= 0){
	return "YES";
  } else {
	return "NO";
  }
};


const stdin = process.openStdin();

process.stdin.on('data', function (chunk) {
  lines = chunk.toString().split('\n');
  lines.map((line, i) => processLine(line, i));
});

function processLine(text, i) {
  if (i === 0) {
    const input = text.toString().trim().toLowerCase();
    let output = '';
    for (let i = 0; i < input.length; i += 1) {
      const char = input.charAt(i);
      if (!['a', 'o', 'u', 'y', 'i', 'e'].includes(char)) {
        output += `.${char}`;
      }
    }
    console.log(output);
  }
}


//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 N = nextInt();
  var s = next();
  var count = 0;
  var output = 0;
  for(var i = 0; i < N; i++){
    if(s[i] == "x"){
      count++;
    }else{
      if(count >= 3){
        output += count - 2;
      }
      count = 0;
    }
  }
  if(count >= 3){
    output += count - 2;
  }
  myout(output);
}


let stdin = process.stdin;
stdin.setEncoding('utf8');
stdin.on('data', function (data) {
    let input = data.split('\n');
    console.log(solution(input[0]));
});

// 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
});

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

  rl.close();
});


const state = { stdin: Buffer.alloc(0) };
const consume = (chunk) =>
  (state.stdin = Buffer.concat(
    [state.stdin, chunk],
    state.stdin.length + chunk.length
  ));
const commit = (answer) => process.stdout.write(answer);
const main = (args) => {
  let [n, m, a] = state.stdin
    .toString("utf8")
    .split(" ")
    .map((e) => parseInt(e));
  let d1 = Math.ceil(n / a);
  let d2 = Math.ceil(m / a);
  let ans = d1 * d2;

  commit(ans.toString());
};
process.stdin.on("data", consume).on("end", main);


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

readline.on('line', line => {
    readline.close(), console.log(capsLocks(line));
});
const capsLocks = (word) => {
    const upperCase = /^[A-ZÑ]+$/g;

    if (word.length > 1)
        if (upperCase.test(word))
            return word.toLowerCase();
        else if (upperCase.test(word.slice(1)) && !upperCase.test(word.charAt(0)))
            return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
        else
            return word;
    else
        if (!upperCase.test(word))
            return word.toUpperCase();
        else
            return word.toLowerCase();
}


'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();
});

const readLine=()=> inputString[currentLine++];
/* ================================================
           Main Solution Starts Here
===================================================*/

const main=()=>{
	let set=new Set()
	let numbers = readLine().split(' ').map(n=>+n)
	numbers.forEach(number=>set.add(number))
	console.log(4-set.size)
}


const readline = require ( 'readline' ) ;

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

r.on ( 'line' , function ( line ) {
    const str = line.toLowerCase() ;
    const bad = 'aouyei' ;
    let ans = '' ;
    for ( let i = 0 ; i < str.length ; i ++ ) {
        if ( bad.indexOf ( str[i] ) < 0 ) {
            ans += '.' + str[i] ;
        }
    }
    console.log ( ans ) ;
    r.close() ;
}) ;


process.stdin.on('data', (data) => {
  if (data == 2) {process.stdout.write("NO");}
  else if (data % 2 === 0) {process.stdout.write("YES");}
  else {process.stdout.write("NO");}
})


const readline = require('readline');

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

var countChar = function(s, item) {
    let ans = 0;
    for (let i = 0; i < s.length; i++) {
        ans += (s[i]==item);
    }
    return ans;
}

/*
while(true){
    input = Console.ReadLine();
}
*/
var ans = 0, met = false;

rl.on('line', (input) => {
   if (input == "BBBBBBBB")
    ans ++;
   else if (!met) {
       met = true;
       ans += countChar(input, 'B');
   }

  }).on('close', function() {

   console.log(ans);
  });
  /*
    WWWBWWBW
    BBBBBBBB
    WWWBWWBW
    WWWBWWBW
    WWWBWWBW
    WWWBWWBW
    WWWBWWBW
    WWWBWWBW
  */


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 row1 = readLine().split(' ').map(Number);
    let row2 = readLine().split(' ').map(Number);
    let row3 = readLine().split(' ').map(Number);
    let row4 = readLine().split(' ').map(Number);
    let row5 = readLine().split(' ').map(Number);
    let finalRowNumber;
    let finalRow;
    if (row1.includes(1)) {
        finalRowNumber = 1;
        finalRow = row1;
    } else if (row2.includes(1)) {
        finalRowNumber = 2;
        finalRow = row2;
    } else if (row3.includes(1)) {
        finalRowNumber = 3;
        finalRow = row3;
    } else if (row4.includes(1)) {
        finalRowNumber = 4;
        finalRow = row4;
    } else if (row5.includes(1)) {
        finalRowNumber = 5;
        finalRow = row5;
    }

    let columnNumber;

    for (let i = 0; i < finalRow.length; i++) {
        if (finalRow[i] === 1) {
            columnNumber = i + 1;
        }
    }

    let result = Math.abs(3 - finalRowNumber) + Math.abs(3 - columnNumber);
    console.log(result);
}


'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().split(' ');
  let x = 0;
  const set = new Set();
  for (let i = 0; i < a.length; i++) {
    set.add(a[i]);
  }
  x = a.length - set.size;
  // output
  print(x);
}


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.num = function() {
		return Number(this.next().value);
	};
nl.nums = function() {
		return this.next().value.split(/\s/g).map(Number);
	};
nl.line = function() {
		return this.next().value;
	}

const sol = () => {
	let [m, d] = nl.nums();
	let month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
	console.log(Math.trunc((d - 1 + month[m-1] + 6)/7));

};

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


'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 [a,b] = readAsIntList();
  for(let i = 1; i <= 10; i++) {
    if((a * 3 ** i) > (b * 2 ** i) ){
      console.log(i);
      return;
    }
  }
}


const readline = require('readline');

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

function main() {
	minimal(stdin[0])
}

var stdin = [];
rl.on('line', function (line) {stdin.push(line);});
rl.on('close', main);
/*
const main = async () => {
  await question1()
  rl.close()
}

main()
*/
function minimal(str) {
	var newStr = str.split('+').sort(function(a, b) {
  	return a - b
  }).join('+');
	console.log(newStr)
}


'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() {

    let direction = readline();
    let origWord = readline();
    var keyboard = [
        ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'],
        ['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';'],
        ['z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/']
    ];
    let rowCount = 3, colCount = 10;

    /*
        s;;upimrrfod;pbr
        allyouneedislove
    */

    if (direction == "R") {
        let result = [];
        // shift left
        for (let index = 0; index < origWord.length; index++) {
            const element = origWord[index];
            var loc = findElementLocation(keyboard, element);
            result.push(keyboard[loc.row][loc.col - 1]);
        }

        process.stdout.write(result.join(''));

    }
    else if (direction == "L") {
        // shift right
        let result = [];

        for (let index = 0; index < origWord.length; index++) {
            const element = origWord[index];
            var loc = findElementLocation(keyboard, element);
            result.push(keyboard[loc.row][loc.col +1]);
        }

        process.stdout.write(result.join(''));
    }

}

function findElementLocation(keyboard, element) {
    for (let row = 0; row < 3; row++) {
        const cols = keyboard[row];
        for (let col = 0; col < 10; col++) {
            const colitem = cols[col];
            if (colitem == element) {
                return {
                    row: row,
                    col: col
                };
            }
        }
    }
    return {
        row: -1,
        col: -1
    };
}


var len = readline();
for(var i=0;i<+len;i++)
{
 var inputData = readline();
 var count = new Set();
for(var j=1;j*j<=+inputData;j++)
{
   count.add(j*j);
}
for(var k=1;k*k*k<=+inputData;k++)
{
   count.add(k*k*k);
}
print(count.size);
}


const readline = require('readline').Interface({
	input: process.stdin,
	output: process.stdout
});
const watermelon = (num) => {
	num = Number(num);
	for (let i = 2; i < num; i += 2) {
		for (let j = 2; j < num; j += 2) {
			if (i + j === num) return 'YES';
		}
	}
	return 'NO';
};

readline.on('line', (num) => {
	readline.close(), console.log(watermelon(num));
});


let lines = [];
require('readline').createInterface({input: process.stdin,output: process.stdout})
				.on('line', line => {lines.push(line);})
				.on('close', () => {console.log(main(lines));});

const main = (input) => {
	let [a, b] = input[0].split(" ").map(num => parseInt(num));
	let counter = 0;
	while (a <= b) {
		counter++;
		a *= 3;
		b *= 2;
	}
	return counter;
}


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

var lines = {};
cs.on("line", (input) => {
  if (input == "") {
    cs.close();
  }
  lines[line_number] = input.split(" ");
  line_number += 1;
}).on("close", () => {
  main();
  process.exit();
});

function isOp(str) {
  return str.length === 1 && str.match(/[<=>]/);
}
function isChr(str) {
  return str.length === 1 && str.match(/[a-z]/i);
}
function isInt(str) {
  return str.length === 1 && !isNaN(str);
}

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

function predict(test) {
  let op = "";
  let ops = [];
  let opVariables = [];
  let limits = [];
  for (let t of test) {
    // console.log(t);
    for (let i = 0; i < t.length; i++) {
      if (isOp(t[i])) {
        op = t[i];
        if (isOp(t[i + 1])) {
          op += t[i + 1];
          i += 1;
        }
        ops.push(op);
        op = "";
      } else if (isChr(t[i])) {
        // console.log(t[i])
        op = t[i];
        for (var j = i + 1; j < t.length; j++) {
          if (isChr(t[j]) || isInt(t[j])) {
            op += t[j];
            i = j;
          } else break;
        }
        opVariables.push(op);
        op = "";
      } else {
        if (i == 0 || (i > 0 && isOp(t[i - 1]))) {
          op = t[i];
          let j = i + 1;
          for (; j < t.length; j++) {
            if (isInt(t[j])) {
              op += t[j];
              i = j;
            } else break;
          }
          limits.push(op);
          op = "";
        }
      }
    }
  }

  let min = limits[0];
  let max = limits[1];

  let pvs = ops.map((o, i) => [o, opVariables[i]]);

  for (let pv of pvs) {
    if (pv[1] == undefined) {
      pv[1] = max;
    }
    // print(`${min} ${pv[0]} ${pv[1]} ?`)
    if (eval(`${min}${pv[0]}${pv[1]}`)) {
      // print(` ${min} ${pv[0]} ${pv[1]} true`)
      min = pv[1];
    } else {
      print("input error");
      process.exit();
    }
  }
}

var n;
function main() {
    for(let r = 0; r < 15; r++) {
        for(let c = 0; c < 15; c++) {
            if (lines[r][c] === '1') {
                print(Math.abs(3-1-r)+Math.abs(3-1-c))
                process.exit()
            }
        }
    }
}


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++];
}
function main() {
  const str = readLine();
  let count_4_7 = 0;

  str.split("").forEach((char) => {
    if (char === "4" || char === "7") count_4_7++;
  });

  if (count_4_7 === str.length || +str % 4 === 0 || +str % 7 === 0 || +str % 47 === 0 || +str % 74 === 0) {
    console.log("YES");
  } else {
    console.log("NO");
  }
}


let fs = require('fs')

let txt = fs.readFileSync(0, "utf-8").split("\r\n").filter(data => {
    return data.length > 0
});
for (let i = 0; i < txt.length; i ++) {
    doit(txt[i])
}

function doit(str) {

    if(str.match("H")!=null || str.match("Q")!=null || str.match("/\+/")!=null || str.match("9")!=null){
        console.log("YES");
    }else{
        console.log('NO');

    }
}


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)
})

rl.on('close', () => {

    let arr = [];
    let bestPosition = [2, 2];

    for (let i = 0; i < inputs.length; i++) {
        const subArr = inputs[i].split(' ');
        arr.push(subArr);
    }

    // Get The position of 1
    let currentPositon = [];
    for (let i = 0; i < arr.length; i++) {

        for (let j = 0; j < arr[i].length; j++) {
            if (arr[i][j] == 1)
                currentPositon.push(i, j);
        }
    }

    // Get the max number that needs minimum steps

    let minimumSteps = 0

    if (currentPositon.toString() != bestPosition.toString()) {
        const rowSteps = currentPositon[0] - bestPosition[0];
        const colSteps = currentPositon[1] - bestPosition[1];
        minimumSteps = Math.abs(colSteps) + Math.abs(rowSteps);
    }

    console.log(minimumSteps);

})


'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++];
}

const main = () => {
	const input = readline()
	let regex = new RegExp(`.*${'hello'.split('').join('.*')}.*`)
	console.log(regex.test(input) ? 'YES' : 'NO')
}


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 word = readLine();
    let target = 'hello';
    let count = 0;
    for (let i = 0; i < word.length; i++) {
        if (count < target.length && word[i] === target[count]) {
            count++;
        }
    }
    if (count === 5) {
        console.log('YES');
    } else {
        console.log('NO');
    }
}


// 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 nNames = str.trim().split('');
    let dFlag = [...new Set(nNames)].length % 2 === 0 ? 'CHAT WITH HER!' : 'IGNORE HIM!';
    return dFlag.toString();

}


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

let input = [];
rl.on('line', function(line) {
	input.push(line);
	if (input.length === 1) {
		//n m a
		theatreSquare(...input[0].split(' '));
		rl.close();
	}
});

let theatreSquare = (n, m, a) => {
	let fArg = parseInt(n) / parseInt(a);
	let secArg = parseInt(m) / parseInt(a);
	let result = Math.ceil(fArg) * Math.ceil(secArg);
	console.log(result);
};


/* eslint-disable no-continue */
/* eslint-disable no-param-reassign */
const readline = require('readline').createInterface({
  input: process.stdin,
});

const values = ['+', '-', '0', '?'];
const processLikes = (x, y) => (x === y ? 2 : Number(x < y));

readline.on('line', (line) => {
  const [x, y, z] = line.split(' ').map(Number);

  console.log(
    processLikes(x + z, y) === processLikes(x, y + z)
      ? values[processLikes(x, y)]
      : values[3],
  );
});


const readline = require('readline');

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

rl.on('line', (input) => {
    let upper = (input.match(/[A-Z]/g) || []).length;
    let lower = (input.match(/[a-z]/g) || []).length;

    if(upper > lower) {
        console.log(input.toUpperCase());
    } else {
        console.log(input.toLowerCase());
    }
    rl.close();
});


const readline = require('readline');

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

rl.on('line', (name) => {
    let newName = ""
    for(let i = 0; i < name.length; i++){
        if(newName.indexOf(name[i]) == -1){
            newName = newName + name[i]
        }
    }
    let message = newName.length % 2 == 0 ? "CHAT WITH HER!" : "IGNORE HIM!"
    console.log(message)
    rl.close()
});


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

function test(t, k,min = 0, max = 100) {
//   console.log(`t=${t}, k=${k}`)
  if ((t < min || t > max) || (k < min || k > max) || t<k) {
    console.log("input error");
    process.exit();
  }
}

var argc = 0;
var n,k
readline.on("line", (input) => {
  if (argc == 0) {
    // test(input);
    [n,k] = input.split(' ').map(i => parseInt(i, 10));
    test(n,k,min=1,max=50)
    // console.log(k)
  } else {
    // this my code belong place
   a = input.split(' ').map(i => parseInt(i,10))
   ak = a.filter(x => x >= a[k-1] && x !== 0 )
//    console.log(n)
  }

  if (argc == 1)
  {
    // console.log(ak)
    console.log(ak.length)
    readline.close();
  }
  else argc += 1;
});


'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();
});

const readLine=()=> inputString[currentLine++];
/* ================================================
           Main Solution Starts Here
===================================================*/

const main=()=>{
	let n = +readLine()
	let str = readLine().toLowerCase()
	let pass = true

	let alpha={}
	for(let i=65;i<=90;i++)
		alpha[String.fromCharCode(i).toLowerCase()]=0

	for(let char of str)
		alpha[char]++

	for(let key in alpha){
		if(alpha[key]===0){
			pass=false
			break
		}
	}

	if(pass)
		console.log('YES')
	else console.log('NO')

}


const readline = require('readline');

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

rl.on('line', input => {
  console.log(min(input.split(' ')));
  process.exit();
});

const min = input => {
  const r = parseInt(input[0]);
  const g = parseInt(input[1]);
  const b = parseInt(input[2]);

  return Math.floor(Math.min((r+g+b)/3, (r+b+g)-Math.max(r,g,b)));
}


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

rl.on('line', function(line) {
	luckyNum(line);
	rl.close();
});

let luckyNum = (input) => {
	// [4,7,44,77,47,74,444,447,474,477,777,774,747,744]
	let luck = [ 4, 7, 44, 77, 47, 74, 444, 447, 474, 477, 777, 774, 747, 744 ];
	let x = luck.filter((el) => {
		if (input % el === 0) return el;
	});
	x.length > 0 ? console.log('YES') : console.log('NO');
};


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

rl.on('line', (d) => {
  let ans = [0, 1, 5];
  let inc = 3;

  for (let i = 3; i <= +d; i++) {
    inc += 2;

    let sum = 0;
    for (let j = 1; j < inc; j += 2) {
      sum += j;
    }

    sum = sum * 2 + inc;
    ans[i] = sum;
  }

  console.log(ans[+d]);
});


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

let currentLine = 0;
let inputString = "";

process.stdin.on("data", (raw_data) => {
  inputString += raw_data;
});

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

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

/******** Main function*************/

function isLowerCase(str) {
  return str == str.toLowerCase() && str != str.toUpperCase();
}

function main() {
  var str = readLine().split("");
  var string = str.join("");
  var Fstr = str[0];
  var EFstr = str.slice(1);

  var count = 0;
  var eFstrCount = 0;

  for (var i = 0; i < EFstr.length; i++) {
    if (isLowerCase(EFstr[i]) === false) {
      eFstrCount++;
    }
  }

  for (var j = 0; j < str.length; j++) {
    if (isLowerCase(str[j]) === false) {
      count++;
    }
  }

  if (eFstrCount == EFstr.length && isLowerCase(Fstr)) {
    console.log(Fstr.toUpperCase() + EFstr.join("").toLowerCase());
  } else if (count === str.length) {
    console.log(string.toLowerCase());
  } else {
    console.log(string);
  }
}

// either it only contains uppercase letters;
// or all letters except for the first one are uppercase.


const readline = require('readline')

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

RL.on('line', line => {
  let [A, B] = line.split(' ').map(x => parseInt(x))
  let years = 0
  do {
    A *= 3
    B *= 2
    years += 1
  } while ( A <= B)
  console.log(years)
})


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 ans = str[0];
  const vowels = {
    a: true,
    e: true,
    i: true,
    o: true,
    u: true,
    y: true,
  };

  for (let i = 1; i < str.length; i++) {
    if (vowels[str[i]] && vowels[ans[ans.length - 1]]) {
      continue;
    } else {
      ans += str[i];
    }
  }

  console.log(ans);

  c++;
});


//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 N = nextInt();
  if(N % 4 == 2 || N % 4 == 1){
    myout(1);
  }else{
    myout(0);
  }
}


let fs = require('fs');

let txt = fs.readFileSync(0, "utf-8").split(/[\n\r]/).filter(data => data.length > 0);

for (let i = 0; i < txt.length; i++) {
    if (!isNaN(txt[i] * 1)) {
        let arr = [];
        for (let i1 = i + 1; i1 < i + txt[i] * 1 + 1; i1++) {
            arr.push(txt[i1].split(/[ ]/).map(data => data * 1));
        }
        doit(arr);
    }

}

function doit(tab) {
    let score = 0;
    for (let i = 0; i < tab.length; i++) {
        for (let i1 = 0; i1 < tab.length; i1++) {
            if (i != i1) {
                if (tab[i][0] == tab[i1][1]) ++score;
            }
        }
    }
    console.log(score);

}


//50A
//118B
const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
rl.question('', (answer) => {
    rl.close()
    let array = answer.split(" ")
    let m = array[0]
    let n = array[1]
    let surfaceArea = m * n
    let dieh = Math.floor(surfaceArea / 2)
    console.log(dieh)
});


'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() {
    const [m, n] = readAsIntList();
    if (m % 2 === 0) {
      console.log((m / 2) * n);
    } else if (n % 2 === 0) {
      console.log((n / 2) * m);
    } else {
      console.log(((Math.max(n,m) - 1) / 2) * Math.min(n,m) + (Math.min(n,m)-1) / 2);
    }
}


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

let a, b, c;
rl.on('line', (line) => {
    [a, b, c] = line.split(' ').map(i => parseInt(i));
}).on('close', () => {
    console.log(Math.ceil(a / c) * Math.ceil(b / c));
});


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

rl.on('line', (d) => {
  console.log(+d - Math.round(+d / 3));
});


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

function main() {
    const t = parseInt(readLine(), 10);
    for(let i = 0; i < t; i++){
        const x = +readLine();
        const arr = readLine().split(' ').map(p => +p);
        let result = myFunc(x, arr);
        console.log(result);
    }
}

function myFunc(x, arr){
    let cont = 0;
    while(arr[x-1] != 0){
        x = arr[x-1];
        cont++;
    }

    return cont > 1 ? 'YES' : '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 print(s) {
  process.stdout.write(`${s}`);
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  let n = 0;
  // input
  for (let i = 0; i < 5; i++) {
    const row = readline().split(' ').map(x => parseInt(x));
    const offsetX = row.indexOf(1);
    if (offsetX > -1) {
      n = Math.abs(offsetX - 2) + Math.abs(i - 2);
    }
  }

  // output
  print(n);
}


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

function solve(){
    let a,b, ans = "";
    a = readLine();
    b = readLine();
    for(let i = 0; i < a.length; i++){
        if(a[i] === b[i])
            ans += '0';
        else ans += '1';
    }
    console.log(ans);
}

function main(){
    solve();
}


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++];
}
function main() {
  const n = +readLine();
  const MOD = 1e9 + 7;
  let [fact, twoPow] = [1, 1];

  for (let i = 1; i <= n; i++) fact = (fact * i) % MOD;

  for (let i = 1; i <= n - 1; i++) twoPow = (twoPow * 2) % MOD;

  console.log((fact - twoPow + MOD) % MOD);
}


const readline = require('readline');

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

let n;

function testCase(n, line) {
  const input_line = line;
  const numbers_string = input_line.split(" ");
  let sum = 0 ;
  for (cur_number in numbers_string) {
    sum += 4 * cur_number * Number(numbers_string[cur_number]);
  }
  console.log(sum);
  rl.close();
}

const program = (line) => {
  if (!n) {
    n = parseInt(line);
  } else {
    testCase(n, line);
  }
};

rl.on('line', program);


'use strict';
// HEADER:
const print = function(arg){
  let str = arg;
  if (arguments.length>1)
    str = Array.prototype.slice.call(arguments).join(' ');
  process.stdout.write(str+'\n');
};
let IS_MULTITEST, testN, tests;
const pcalc = (testN, toPrint)=>{
  let res = calc(testN);
  if (Array.isArray(res)){
    toPrint.push(res.join(' '));
  } else if (Number.isFinite(res) || typeof res=='string'){
    toPrint.push(res+'');
  }
  if (process.env.DEBUG && toPrint.length){
    let ans = toPrint.pop();
    print(ans);
    let expected = tests[testN-1];
    if (expected){
      if (expected==ans)
        console.log('\x1b[32m%s\x1b[0m', 'correct');
      else {
        console.log('\x1b[31m%s\x1b[0m', 'wrong, expected:', expected);
      }
    }
  }
};

const main = ()=>{
  let toPrint = [];
  L('\nSolving:');
  if (IS_MULTITEST){
    let T = +readline()
    for (testN=1; testN<=T; testN++)
      pcalc(testN, toPrint);
  } else {
    pcalc(1, toPrint);
  }
  if (toPrint.length){
    print(toPrint.join('\n'));
  }
};

const lines = [];
const rl = require('readline').createInterface({
   input: process.stdin, output: process.stdout});
rl.on('line', line=>{
  lines.push(line);
});
rl.on('close', main);
let rli = 0;
const readline = ()=>lines[rli++];
const L = process.env.DEBUG ? console.log : ()=>{};
const LT = obj=>L(`\nTest #${testN}`, obj);

const ra = ()=>readline().split(' ').map(a=>+a)
const pa = arr=>print(arr.join(' '));

tests = [
``, // Test #1
``, // Test #2
``, // Test #3
``, // Test #4
``, // Test #5
];

// SOLUTION:
IS_MULTITEST = false;

const calc = (testN)=>{
  // READING:
  let [n, x] = readline().split(' '); // 10x18
  n = +n;
  LT({n, x});
  // PROCESSING:
  if (n==x.length)
    return 0;
  let queue = [], qi = 0;
  queue.push([x, 0]);
  let visited = new Set([x]);
  while (qi<queue.length){
    let [X, path] = queue[qi++];
    if (X.length==n)
      return path;
    let nX = BigInt(X);
    let tried = {};
    for (let i=0; i<X.length; i++){
      if (tried[X[i]] || X[i]=='0' || X[i]=='1')
        continue;
      tried[X[i]] = 1;
      let next = (nX * BigInt(X[i])).toString();
      if (next.length==n)
        return path+1;
      if (next.length>n || visited.has(next))
        continue;
      visited.add(next);
      queue.push([next, path+1])
    }
  }
  return -1;
};


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

readline.on('line', line => {
  var number = parseInt(line);
  console.log(number % 2 === 0 && number > 2 ? "YES" : "NO");
  readline.close();
});


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++];
}
function main() {
  var arr = readLine().split(" ").map(Number);
  var arr1 = arr[0];
  var arr2 = arr[1];
  console.log(Math.floor((arr1 * arr2) / 2));
}


const readline = require('readline')

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

rl.on("line", (w)=>{
	if(w == 2){
	       	console.log("NO")
	return
	}
	const r = w%2 ===0 ? "YES" : "NO"
       console.log(r)
})


const readLine = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});
const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  const message = input[0].split('');
  const word = [0,0,0,0];
  message.forEach(letter => {
    if (letter === 'h' && word[0] === 0) word[0] += 1;
    if (letter === 'e' && word[0] === 1) word[1] += 1;
    if (letter === 'l' && word[1] >= 1) word[2] += 1;
    if (letter === 'o' && word[2] >= 2) word[3] = 1;
  });

  console.log(word[3] === 1 ? "YES" : "NO");
});


var n=0, p=0, q=0;
const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
})

readline.question(``, (n) => {

    q= n%4;
    if(n==0) console.log("1");
    else if(q==0)  console.log("6");
    else if(q==1)  console.log("8");
    else if(q==2)  console.log("4");
    else if(q==3)  console.log("2");
  readline.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();
    });

    main();
});

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

function main(){
    let num = parseInt(readline())
    let out ;
    while(true){
        num++;
        let s = new Set(num.toString().split(''))

        if(s.size == 4 ){
            out = num
            break;
        }
    }
    console.log(num);
}


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

rl.on('line', (str) => {
  const vowels = ['a', 'e', 'i', 'o', 'u', 'y'];
  const newStr = str.replace(/\s+/g, '').replace(/\?+/g, '');

  if (vowels.includes(newStr[newStr.length - 1].toLowerCase())) {
    console.log('YES');
  }
  else {
    console.log('NO');
  }
});


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

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

readLine.on('close', () => {
// CODE HERE
	let [a, b] = input[0].split(' ').map(x => +x);
	for(let i = 1; i > 0; i++){
          a = 3*a;
          b = 2*b;
          if ( a > b){
            console.log (i);
            break;
          }
    }
});


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

rl.on('line', (d) => {
  let n = Number(d);
  let steps = 0;
  let substract = 5;

  while (n > 0) {
    while (substract <= n && n !== 0) {
      n -= substract;
      steps++;
    }

    substract--;
  }

  console.log(steps);
});


const readline = require('readline');

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

rl.on('line', (input) => {

  var splitstr = input.split(" ")
  var a = parseInt (splitstr[0])
  var b = parseInt (splitstr[1])
  var c = parseInt (splitstr[2])
  var y = Math.ceil(a/c)
  var x = Math.ceil(b/c)
  console.log(x*y)

})


let store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];

function checkDigit(n, dig) {
  if (dig === 0 && n === 0) {
    return { count: 0, decrement: 0 };
  }
  return {
    count: 1,
    decrement: Math.max(n, dig) - n
  };
}

function splitNumber(n) {
  const digitsPow = 10 ** Math.floor(Math.log10(n));
  let first = Math.floor(n / digitsPow);
  let tail = n % digitsPow;
  return [first, tail];
}

function solveCore(n, dig = 0) {
  if (store[dig][n]) {
    return store[dig][n];
  }
  if (n < 10) {
    return (store[dig][n] = checkDigit(n, dig));
  }

  let rest = n;
  let [first, tail] = splitNumber(rest);
  let count = 0;

  while (rest > 0) {
    const r = solveCore(tail, Math.max(first, dig));
    count += r.count;
    rest -= tail + r.decrement;
    [first, tail] = splitNumber(rest);
  }

  return (store[dig][n] = { count, decrement: -rest });
}
function solve(n) {
  store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];
  const r = solveCore(n, 0);
  return r.count;
}

function* main() {
  const n = parseInt(yield);
  const r = solve(n);
  console.log(r);
  process.exit(0);
}

if (!module.parent) {
  (() => {
    const q = main();
    q.next();
    require("readline")
      .createInterface({
        input: process.stdin,
        output: null
      })
      .on("line", line => q.next(line));
  })();
}

exports.solve = solve;


process.stdin.resume()
process.stdin.setEncoding("utf-8")
let inputString = ""
let lines = []
let currentLine = 0
process.stdin.on("data", (inputStdin) => {
  inputString += inputStdin
})
process.stdin.on("end", (_) => {
  lines = inputString
    .trim()
    .split("\n")
    .map((string) => {
      return string.trim()
    })
  main()
})

function readline() {
  return lines[currentLine++]
}

function main() {
  const a = readline()
    .split(" ")
    .map((x) => parseInt(x))
  console.log(Math.ceil(a[0] / a[2]) * Math.ceil(a[1] / a[2]))
}


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++];
}

function multiply(a, b) {
	a = a.toString(10).split('').reverse();
	b = b.toString(10).split('').reverse();

	if (a.length < b.length) {
		[a, b] = [b, a];
	}

	let res = Array(a.length + b.length).fill(0);
	for (let i = 0, lb = b.length; i < lb; ++i) {
		let carry = 0;
		let scarry = 0;
		for (let j = 0, la = a.length; j < la; ++j) {
			let m = b[i] * a[j];
			m += carry;

			if (m > 9) {
				let [c, d] = m.toString(10).split('');
				res[i + j] += (scarry >> 0) + (d >> 0);
				carry = c >> 0;
			} else {
				res[i + j] += (scarry >> 0) + m;
				carry = 0;
			}

			if (res[i + j] > 9) {
				let [c, d] = res[i + j].toString(10).split('');
				res[i + j] = d >> 0;
				scarry = c;
			} else {
				scarry = 0;
			}
		}
		if (carry > 0) res[a.length + i] = carry;
		if (scarry > 0) res[a.length + i] = scarry;
	}

	res.reverse();
	let mulVal = '';
	let flag = false;
	res.forEach(d => {
		if (!flag && d !== 0) flag = true;
		if (flag) mulVal += d;
	});
	return mulVal;
}

function main() {
	let [s1, s2, s3] = readLine()
		.split(' ')
		.map(x => x >> 0);
	let res =
		4 *
		(Math.sqrt((s1 * s3) / s2) +
			Math.sqrt((s1 * s2) / s3) +
			Math.sqrt((s2 * s3) / s1));
	console.log(Math.floor(res));
}


var readline= require('readline');
var rl = readline.createInterface(process.stdin, process.stdout);
rl.question('', (arg1)=>{
	rl.question('', (arg2)=>{
		var c = 0;
		for (var i = 0; i < arg1; i++) {
			if(arg2[i]==8){
				c++;

		}
	}
		arg1=Math.floor(arg1/11);
		if (c>arg1) {
		c=arg1;

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

});


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

rl.on('line', (d) => {
  let curr = 0;
  let n = +d;
  let ans = 'NO';

  let inc = 0;
  while (curr <= n) {
    curr = inc * (inc + 1) / 2;
    if (curr === n) {
      ans = 'YES';
    }
    inc++;
  }

  console.log(ans);

  c++;
});