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 k = +readLine();
  const l = +readLine();
  const m = +readLine();
  const n = +readLine();
  const d = +readLine();
  const arr = Array(d).fill(1);
  let count = 0;
  function isDivisible(num) {
    return num % k === 0 || num % l === 0 || num % m === 0 || num % n === 0;
  }
  for (let i = 0; i < d; i++) {
    if (arr[i] === 1 && isDivisible(i + 1)) {
      arr[i] = -1;
    }
  }
  for (let i = 0; i < d; i++) {
    if (arr[i] === -1) count++;
  }
  console.log(count);
}


const main = async () => {
    const arr = [];
    let len = [];

    const rl = require("readline").createInterface({
      input: process.stdin,
      output: process.stdout,
    });
    let m,n;
    let i = 1;
    for await (const line of rl) {

      if (!len.length) {
            len = line.split(' ').map(Number);
            n = len[0];
            m = len[1];
            arr[n+1] = [];
            arr[0] = [];
            for (let x = 0; x < m+2; x++) {
                arr[0].push('.');
                arr[n+1].push('.');
            }
    } else {
            if (i < n) {
                arr[i] = ['.'];
                arr[i].push(...line.split(''));
                arr[i].push('.');
            } else {
                arr[i] = ['.'];
                arr[i].push(...line.split(''));
                arr[i].push('.');
                rl.close();
            }
            i++;
      }
    }
    runGame(arr, m, n);
  };

  const runGame = (arr, m, n) => {
    let output = 0;

    for (let i = 1; i < n + 1; i++) {
        for (let j = 1; j < m + 1; j++) {
            if (arr[i][j] == 'W') {
                if (arr[i-1][j] == 'P' || arr[i+1][j] == 'P' || arr[i][j-1] == 'P' || arr[i][j+1] == 'P' ) {
                    output++;
                }
            }

        }
    }
    console.log(output);
  };

  main();


// https://codeforces.com/problemset/problem/112/A

function main(stdin) {
  const a = stdin.shift().toLowerCase()
  const b = stdin.shift().toLowerCase()
  process.stdout.write(a.localeCompare(b) + '')
}

// Handle standard input
process.stdin.resume()
process.stdin.setEncoding('utf-8')

let inputString = ''

process.stdin.on('data', (inputStdin) => inputString += inputStdin)
process.stdin.on('end', () =>
  main(inputString.trim().split('\n').map(s => s.trim())))


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

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

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

  let answer = 0; let min = Number.MAX_SAFE_INTEGER;

  for (let i = 0; i < nums.length; i += 1) {
    if ( i + n - 1 < nums.length && nums[i + n - 1] - nums[i] < min) {
      min = nums[i + n - 1] - nums[i];
    }
  }

  console.log(min);
});


var stdin = process.openStdin();

stdin.addListener("data", function(d) {
    const arr = d.toString().trim().split(" ");
    console.log(findg(parseInt(arr[0]), parseInt(arr[1])));
  });

 function findg(n, m){
    if(n === m){
        return 0;
    } else if(m === 0){
        return 1;
    }
    m--;
    n--;
    let gcount  = 1;
    for(let i = 0; i < m; i++){
        if(n === 0 || n === 1){
            gcount--;
        } else if (n === 2) {
            n-=2;
        } else {
            gcount++;
            n-=2;
        }
    }
    return gcount;
 }


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

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

  if (y - x >= 0 && z - x >= 0) {
    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', () => {
  input.forEach( (line , i) => {
    line.split(' ').forEach( (x, j) => {
      if (x === '1') {
        console.log(
          Math.abs(2-i) + Math.abs(2-j)
        );
        process.exit();
      }
    });
  });
});


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

rl.on('line', function(line) {
    var l = line.split(' ');
    var num = l[0];
    var count = +l[1];
    function ws(num, c) {
        if (c === 0 || num == '0') {
            console.log(num);
        } else {
            var n = (''+num).split('');
            if (n[n.length-1] == 0) {
                n[n.length-1] = ''
            } else {
                n[n.length-1] = (+n[n.length-1]) - 1;
            }
            ws(n.join(''), c-1);
        }
    }
    ws(num, count);
	rl.close();
});


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

//Don't have to see. end------------------------------------------
function Main(){
	var one = nextIntArray();
	var A = one[0];
	var B = one[1];
	var C = one[2];
	var output = 0;
	if(C - 1 <= B && C - 2 <= A){
		output = Math.max(output, 3 * C - 3);
	}
	if(B - 1 <= A && B + 1 <= C){
		output = Math.max(output, 3 * B);
	}
	if(A + 1 <= B && A + 2 <= C){
		output = Math.max(output, 3 * A + 3);
	}
	myout(output);
}


const find = (tasks, reserved) => {
    let bad = tasks * 2;
    let good = 0;
    let perTask = 5;

    const sum = (tasksCount) =>
        (2 * perTask + perTask * (tasksCount - 1))
            / 2
            * tasksCount
            + reserved;

    while (bad - good > 1) {
        let middle = (good + bad) >> 1;

        if (sum(middle) <= 240) {
            good = middle;
        } else {
            bad = middle;
        }
    }

    console.log(Math.min(good, tasks));
};

let _input = "";

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

process.stdin.on("end", function () {
   find(..._input.split('\n')[0].split(' ').map(Number));
});


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));
  let count = 0;

  const max = Math.max(n, m);
  for (let a = 0; a <= max; a++) {
    for (let b = 0; b <= max; b++) {
      if (a * a + b === n && a + b * b === m) count++;
    }
  }
  console.log(count);
}


let globalStdin = '';
const {EOL} = require('os');
process.stdin.on('data', i => globalStdin += i);

process.stdin.on('end', async () => {
  const lines = globalStdin.split(EOL);
  let [n, k] = lines[0].split(' ').map((v) => parseInt(v));
  let dp = Array.from({length: n+1}, () => new Array(n+1).fill(0));
  dp[0][0] = 1;
  let prev = {};
  for (let i = 1; i <= n; i++) {
    dp[i][0] = 1;
    let c = lines[1][i-1];
    for (let j = 1; j <= n; j++) {
      dp[i][j] = dp[i-1][j-1] + dp[i-1][j];
      if (prev[c]) dp[i][j] -= dp[prev[c] - 1][j - 1];
    }
    prev[c] = i;
  }
  let sum = 0;
  for (let i = n; i >= 0; i--) {
    if (dp[n][i] > k) {
      sum += (n - i) * k;
      k = 0;
      break;
    }
    k -= dp[n][i];
    sum += (n - i) * dp[n][i];
  }
  console.log(k ? -1 : sum);
});


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

let inputString = '';
let currentLine = 0;

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

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

    main();
});

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

function main() {
  const l = parseInt(readLine().split(' '));

let arr = [];
  let matrix = [];
  for (let i = 0; i < l; ++i) {
    matrix[i] = [];
    for (let j = 0; j < l; ++j) {
      if (i == 0 && j == 0) {
        matrix[i][j] = 2;
      } else if (j == 0) {
        matrix[i][j] = matrix[i - 1][j] + 1;
      } else if (i == 0) {
        matrix[i][j] = matrix[i][j - 1] + 1;
      } else {
        matrix[i][j] = matrix[i - 1][j] + matrix[i][j - 1];
      }

      matrix[0][j] = 1;
      matrix[i][0] = 1;
    }
  }

  for (let g = 0; g < l; ++g) {
    for (k = 0; k < l; ++k) {
      if (k == g) {
        arr.push(matrix[g][k]);
      }
    }
  }
  console.log(arr.pop());
  }


'use strict';

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

let inputString = '';
let currentLine = 0;

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

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

    main();
});

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

function main() {
    let s = readLine();
    let totalOfLowerCase = s.split('').filter((value) => {
        return value.charCodeAt(0) >= 97
    }).length;
    let totalOfUpperCase = s.split('').filter((value) => {
        return value.charCodeAt(0) < 97
    }).length;
    if (totalOfUpperCase > totalOfLowerCase) {
        console.log(s.toUpperCase());
    } else {
        console.log(s.toLowerCase());
    }
}


//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();
  while(true){
  	var tmp = makeClone(N);
  	var sum = 0;
  	while(tmp > 0){
  		sum += tmp % 10;
  		tmp = Math.floor(tmp / 10);
  	}
  	if(sum % 4 == 0){
  		myout(N);
  		return;
  	}
  	N++;
  }
}


async function solve() {
  let s = await line()
  const vk = s.split('VK').length - 1
  s = s.split('VK').join('X')
  const vv = s.split('VV').length > 1
  const kk = s.split('KK').length > 1

  print(vk + (vv || kk ? 1 : 0))
}

// read the input
const readline = require('readline')
const _lines = []
let _lineIndex = 0
let _ended = false
const _rl = readline.createInterface(process.stdin)
_rl.on('line', line => _lines.push(line))
_rl.on('end', () => (ended = true))
const wait = ms => new Promise(resolve => setTimeout(resolve, ms))
const line = async () => {
  while (!_ended && _lines.length <= _lineIndex) await wait(10)
  const result = _lines[_lineIndex].trim()
  _lines[_lineIndex] = null
  _lineIndex++
  return result
}
const words = async () => (await line()).split(' ')
const chars = async () => (await line()).split('')
const int = async () => parseInt(await line())
const ints = async () => (await words()).map(x => parseInt(x))
const big = async () => BigInt(await line())
const bigs = async () => (await words()).map(x => BigInt(x))

const print = console.log

solve()


let readline  = require('readline');
let intInput = readline.createInterface({
	input: process.stdin,
	output: process.stdout
});
let num, i = 2;

intInput.on('line', (line) => {
	num = Number(line)
});

intInput.on('close', () => {
	let staticNum = num;
	let c = 0;
	let result = 1;
	let dict = {};
	while (i <= staticNum){
		if (num % i == 0){
			num = num / i;
			c++;
		} else {
			dict[i] = c;
			c = 0;
			i++
		}
	}
	for (let key in dict){
		let c  = dict[key]
		result = result * (c + 1)
	}
	console.log(result - 1);
})


const readline = require('readline');

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

    if (x%2 === 0 && x!=2 ) {
        console.log('YES');

    }else  {
        console.log('NO')
    }

  })


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

    const input = lines[1];
    const vector = input.split(' ').map(
        n => parseInt(n)
    );

    const insertionSort = (vector) => {
        let res = 0;

        for (let i = 0; i < vector.length; i++) {
            let minIndex = i;

            for (let j = i + 1; j < vector.length; j++) {
                if (vector[j] < vector[minIndex]) {
                    minIndex = j;
                }
            }

            let temp = vector[i];
            vector[i] = vector[minIndex];
            vector[minIndex] = temp;

            if (i !== 0 && i % 2 === 1) {
                res += vector[i] - vector[i -1]
            }
        }

        console.log(res);
    };

    insertionSort(vector);
});

//////


'use strict';

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

let inputString = '';
let currentLine = 0;

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

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

  main();
});

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

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

function main() {
  // input
  let [a, b] = readline().split(' ').map(x => parseInt(x));

  // solve
  let i = 0;

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

  // output
  print(i);
}


'use strict';

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

let inputString = '';
let currentLine = 0;

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

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

    main();
});

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

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

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

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

function main() {
  let s = readline();
  let n = s.replace(/[^47]+/gi,'').length;
  console.log([4,7].includes(n) ? 'YES' : 'NO');
}


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

readline.question("", nk => {
    readline.question("", c => {
        nk = nk.split(" ");
        c = c.split(" ");
        console.log(c.filter(p => {return p >= parseInt(c[nk[1] - 1]) && p >= 1 ? p : void 0;}).length)
        readline.close();
    })
})


const readline = require('readline');

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

rl.on('line', line => {
    var result = line.toLowerCase().replace(/[aoyeui]/g,'').split('').join('.');
    console.log(result ? '.' + result : result);
    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", function() {
  inputString = inputString
    .replace(/\s*$/, "")
    .split("\n")
    .map(str => str.replace(/\s*$/, ""));

  main();
});

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

function main() {
  const firstLine = readLine();
  const weight = parseInt(firstLine, 10);
  // const a = readLine().split(' ').map(aTemp => parseInt(aTemp, 10));

  console.log(watermelon(weight));
}

function watermelon(weight) {
  return weight === 2 || (weight & 1) === 1 ? "NO" : "YES";
}


'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 s1 = readline().toLowerCase();
    let length = [];
    for (let i =0,c=s1.length ; i < c  ; i++ ){
     if (length.indexOf(s1[i]) === -1 ) length.push(s1[i])
    }

    console.log((length.length % 2 === 0 ) ? "CHAT WITH HER!": "IGNORE HIM!")
}


'use strict';

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

let inputString = '';
let currentLine = 0;

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

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

    main();
});

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

function main() {
    let k = parseInt(readLine());
    let l = parseInt(readLine());
    let m = parseInt(readLine());
    let n = parseInt(readLine());
    let d = parseInt(readLine());
    let cont = d;
    if (k == 1 || l == 1 || m == 1 || n == 1) {
        console.log(cont);
    } else {
        for (var i = 1; i <= d; i++) {
            if ((i % k != 0) && (i % l != 0) && (i % m != 0) && (i % n != 0)) {
                cont--;
            }
        }
        console.log(cont);
    }
}


const {EOL} = require('os')

let ipt = ''
process.stdin.on('data', s => ipt += s)
process.stdin.on('end', () => {
  let [h, m] = ipt.split(EOL).slice(0, -1)[0].split(':').map(v => parseInt(v))
  if (h >= 12) h -= 12

  let y = m * 6
  let x = h * 30 + y / 12

  console.log(x, y)
})


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

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

readLine.on('close', () => {
  let [n, k] = input[0].split(' ').map(x => +x);
  for (let i = 0; i < k; i++) {
    n = n % 10 === 0 ? Math.floor(n / 10) : n - 1;
  }
  console.log(n);
});


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

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

  let mid = Math.floor(n / 2);
  let x = mid % (k + 1);
  let a = (mid - x) / (k + 1);
  let b = a * k;
  let c = n - a - b;

  console.log(`${a} ${b} ${c}`);
});


//118B
const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
rl.question('', (answer) => {
    rl.close()
  let word = answer.toLowerCase()
  let noVowel = word.replace(/a|e|i|o|u|y/gi, "")
  let wordArray = noVowel.split("")
  let finishedArray = []
  wordArray.forEach(function(word) {
      finishedArray.push(`.${word}`)
  })
  let finalword = finishedArray.join("")
  console.log(finalword)
});


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

const input = [];
readLine.on('line', line => input.push(line));
const translation = () => {
    let ar = [];
    for (const x of input[0]) {
        ar.push(x);
    }
    let newString = '';
    for (let i = ar.length-1; i >= 0; i--) {
        newString += ar[i];
    }
    console.log(newString === input[1] ? 'YES' : 'NO');
};
readLine.on('close', translation);


var readline = require('readline');
var  rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
//rl.question();
rl.question('', (input) => {
    var ans = main(input.split(' '));
    console.log(ans);
    process.exit();
});
function main(input){
    var m = Number(input[0]);
    var n = Number(input[1]);
    var a = Number(input[2]);
    var ans;
    ans = Math.ceil(m/a)*Math.ceil(n/a);
    return ans;
}


'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').join(' ').split(' ').map(string => {
        return string.trim();
    });

    main();
});

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

function main() {
    const n = Number(read())
    if (n % 2 === 0 && n > 2) {
        process.stdout.write("YES")
    } else {
        process.stdout.write("NO")
    }
}


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

function _main() {

	_inputLines = _inputData.trim().split('\n').map((string) => {
		return string.trim();
	});;
	let [n, k] = inputReader.readNumberArray();
	let arr = inputReader.readNumberArray();
	let total = 0,
		extra = 0,
		flag = false,
		days = 0;
	for (let i = 0; i < arr.length; i++) {
		if (arr[i] >= 8) {
			total += 8;
			extra += arr[i] - 8;
			days++;
		} else {
			total += arr[i];
			days++;
			if (extra + arr[i] <= 8) {
				total += extra;
				extra = 0;
			} else {
				let temp = 8 - arr[i];
				extra -= temp;
				total += temp;
			}
		}
		if (total >= k) {
			flag = true;
			break;
		}
		//console.log(extra,total);
	}
	if (flag) console.log(days);
	else console.log(-1);

}

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

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

function _inputReader () {
	function readNumberArray(){
		return _inputLines[_lineNumber++].split(' ').map(val => Number(val));
	}

	return {
		readNumberArray,
	}
}


const readline = require("readline");

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

const solver = input => {
  let result = input[0];
  for (let i = 0; i < input[1]; i++) {
    result = (result % 10 != 0) ? result - 1 : result / 10;
  }
  console.log(result);
};

rl.on("line", l => {
  rl.close();
  solver(l.split(' ').map(x => parseInt(x)));
});


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

//Don't have to see. end------------------------------------------
function Main(){
	var one = nextIntArray();
	var k = one[0];
	var n = one[1];
	var s = one[2];
	var p = one[3];
	var req = k * Math.ceil(n / s);
	myout(Math.ceil(req / p));
}


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

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


const funkyNumbers = n => {
    let funkyNumber = 'NO';

    let maxTriangle = maxTrianglePossible(n);

    for(let i = maxTriangle; i > 0; i--) {
        let firstTriangle = triangleNumbers(i);
        let rem = n - firstTriangle;

        if(rem === 0) continue;

        let secFactor = maxTrianglePossible(rem);
        let secTriangle = triangleNumbers(secFactor);

        let triangles = firstTriangle + secTriangle;

        if(triangles == n) {
            funkyNumber = 'YES';
            break;
        }

    }

    return funkyNumber;
}

const maxTrianglePossible = n => Math.floor( Math.sqrt(n*2) );

const triangleNumbers = x => ( x * (x + 1) ) / 2;

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

readline.on('line', n => {
    readline.close();

    let res = funkyNumbers(n);
    console.log(res);
});


let z = '';
process.stdin.on('data', c => z += c);
process.stdin.on('end', () => {
    const {
        EOL
    } = require('os');
    let input = z.split(EOL)[0];
    input = input.split(' ').map(item => parseInt(item));
    while (true) {
        if (input[1] === input[3]) {
            console.log('YES');
            return 0;
        }
        if (input[1] === input[2] || input[3] === input[4]) {
            break;
        }

        input[3] = (input[3] === 1) ? input[0] : (input[3] - 1);
        input[1] = (input[1] === input[0]) ? 1 : (input[1] + 1);
    }
    if (input[1] === input[3])
        console.log('YES');
    else
        console.log('NO');

});


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

  for (let i = 0; i < str.length; i++) {
    const [prevNum, currentNum, nextNum] = [+str[i - 1], +str[i], +str[i + 1]];

    if (currentNum !== 1 && currentNum !== 4) {
      console.log("NO");
      return;
    }
    if (currentNum === 4) {
      if (prevNum !== 1 && prevNum !== 4) {
        console.log("NO");
        return;
      }
      if (prevNum === 4 && nextNum !== 1 && i < str.length - 1) {
        console.log("NO");
        return;
      }
    }
  }
  console.log("YES");
}


'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 input1 = readline().split(' ');
  let students = input1[0];

  let puzzles = readline().split(' ');
  puzzles = puzzles.map(ele => parseInt(ele));

  leastDifference(students, puzzles);
}

function leastDifference(students, puzzles){
  puzzles = puzzles.sort((a, b) => a - b);

  let minDif = Infinity;

  let startIdx = 0;
  let endIdx = students - 1;

  while(endIdx < puzzles.length){
    let curDif = puzzles[endIdx] - puzzles[startIdx];
    minDif = Math.min(minDif, curDif);
    startIdx ++;
    endIdx++;
  }
  console.log(minDif);
  return minDif;
}


const { stderr } = require("process");

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

readline.on("line", (line) => {
  const str = line.split(" ")[0];
  readline.close();
  main(str);
  return;
});

const main = (str) => {
  const string = str.toLowerCase();
  const vowelSet = new Set(["a", "o", "y", "e", "u", "i"]);
  let result = "";
  const stringArr = [...string];

  stringArr.forEach((val) => {
    if (!vowelSet.has(val)) {
      result += ".";
      result += val;
    }
  });
  console.log(result);
  return;
};


// https://codeforces.com/problemset/problem/977/B
// Big O:
// n: string length
// Time complexity: O(n)
// 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 = "";
    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;
        const mostCommonOccurrences = gramOccurrences[mostCommonGram] ? gramOccurrences[mostCommonGram] : 0;
        if (occurrences > mostCommonOccurrences) {
            mostCommonGram = twogram;
        }

        gramOccurrences[twogram] = occurrences;
    }

    return mostCommonGram;
}


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

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

readLine.on('close', () => {
  const home = [], setOut = {};
  let answer = 0;
  input.forEach((x, i) => {
    if (i === 0) return;
    let nums = x.split(' ').map(x => parseInt(x));
    home.push(nums[0]); (setOut[nums[1]] === undefined) ? setOut[nums[1]] = 1 : setOut[nums[1]] += 1;
  });

  home.forEach(i => {
    if (setOut[i] !== undefined) answer += setOut[i];
  });

  console.log(answer);
});


let fs = require("fs");

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

    doit(txt[index] * 1);

}

function doit(num) {
    let lucky = [4, 7, 47, 74, 444, 447, 744, 774, 777]
    let tab = String(num).split("").filter(data => {
        if (data != 4 && data != 7 && data != " ") {
            return data;
        }
    }).length;
    if (tab == 0) {
        console.log("YES");
    }  else {
        for (let i = 0; i < lucky.length; i++) {
            if(num%lucky[i]==0){
                console.log("YES");
                return;
            }
        }
        console.log("NO");
    }
}


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


const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
let input = [];
readline.on('line', line => {
  input.push(line);
});
process.stdin.on('end', () => {
  const inp = input[0].split(' ');
  const max = Math.max(inp[0], inp[1]);
  const map = {
    1: "1/1",
    2: "5/6",
    3: "2/3",
    4: "1/2",
    5: "1/3",
    6: "1/6",
  };
  console.log(map[max]);
});


const solve = (w) => {
    if (w == 2) return false;
    if (w % 2 != 0) return false;
    return true;
};

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

    let input;
    rl.on('line', (line) => {
        input = Number(line);
    });

    rl.on('close', () => {
        let res = solve(input) ? 'YES' : 'NO';
        console.log(res);
    });

};

main()


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(' ').map(Number).sort((a, b) => a - b);
  let ans = 0;

  for (let i = 0; i < arr.length; i++) {
    if (i % 2) {
      ans += arr[i];
    }
    else {
      ans -= arr[i];
    }
  }

  console.log(Math.abs(ans));

  c++;
});


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

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

  arr.push(d.split(' ').map(Number));

  c++;
});

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

  for (let i = 0; i < arr.length; i++) {
    for (let j = 0; j < arr.length; j++) {
      if (i == j || i == Math.floor(n / 2) || j == Math.floor(n / 2) || i + j == n-1) {
        ans += arr[i][j];
      }
    }
  }

  console.log(ans);
});


const readline = require('readline').createInterface({input: process.stdin})
let lines = [];
readline.on("line", line => {
    lines.push(line);
}).on("close", () => {

    let stones = lines[1];
    let removed = 0;

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

    console.log(removed);

});


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 arr = [...str];
  const len = arr.length;
  for (let i = 2; i <= len; i++) {
    if (len % i === 0) {
      const firstPart = arr.slice(0, i);
      const secondPart = arr.slice(i);

      firstPart.reverse();

      arr = [...firstPart, ...secondPart];
    }
  }

  console.log(arr.join(''));

  c++;
});


let fs = require("fs");

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

function doit(str) {
    let mot = ["h", "e", "l", "l", "o"]
    let tab = str.split("").filter(data => {
        return data.length > 0
    })
    let pnt=-1;
    for (let i = 0; i < mot.length; i++) {
        let t=tab.map((data1,index)=>{if(mot[i]==data1)return index;}).filter(data=>{return data!=undefined});
        if(t.length==0){
            console.log("NO");
            return;
        }
        let test=false;
        for (let i1 = 0; i1 < t.length; i1++) {
            if(t[i1]>pnt){
                pnt=t[i1]
                test=true
                break;
            }
        }
        if(!test){
            console.log("NO");
            return;
        }
    }
    console.log("YES");

}


'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 n = +readline();
  const p = readline();
  const m = new Set();
  for (let i = 0; i < n; i++) {
    m.add(p.charAt(i).toLocaleLowerCase());
  }
  print(m.size === 26 ? 'YES' : 'NO');
}


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

readline.question('', str=>{
    let arr=[];
    for(let i=0;i<str.length;i++){
        if(!arr.includes(str[i])){
            arr.push(str[i])
        }
    }
    if(arr.length%2===0){
        console.log('CHAT WITH HER!')
    }
    else if(arr.length%2==1){
        console.log('IGNORE HIM!')
    }
})


'use strict';

function solve(n, a) {
  let cur = n;
  let cnt = 0;
  while (cur) {
    cnt++;
    cur = a[cur - 1];
  }
  return cnt === 3 ? 'YES' : 'NO';
}

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

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


let data = '';
process.stdin.on('data',c => data += c);
const solution = () => {
	let [n, k, m] = data.split(' ').map(v => parseInt(v, 10));
	let r = Math.trunc(((m-1)%(2*k))/2) + 1;
	let d = Math.trunc((m-1)/(2 * k)) + 1;
	let v = (m%2 === 0)?"R":"L";
	console.log(`${d} ${r} ${v}`);
};

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


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

let stdinInput = '';

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

process.stdin.on('end', () => {
  main(stdinInput);
})

function main(data) {
    data = data.split(/\r?\n/);
    data = data[0].split(" ");
    solve(data)
}

function solve(numbers) {
    let num = numbers[0] * 1
    let sub = numbers[1]

    let i;
    for(i = 0; i < sub; i++) {
        if (num % 10 === 0) {
            num = Math.floor(num / 10)
        } else {
            num = num - 1
        }
    }
    console.log(num)
}


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

let l = 0;
rl.on('line', (input) => {
    if (l === 0) { l++ }
    else {
        rl.close();
        let arr = input.split(" ").map(x => parseInt(x))
        let cnt = 0
        let max = 0
        for (let i = 1; i < arr.length; i++) {
            if (arr[i]===arr[i-1]+1) {
                cnt++
                if(i===1 && arr[i-1]===1){
                    cnt++
                }
                if(i+1<arr.length&&arr[i]+1!==arr[i+1]){
                    cnt--
                }
                if(i===arr.length-1 && arr[i]!==1000){
                    cnt--
                }
                if(cnt>max){
                    max=cnt
                }
            } else {
                cnt=0
            }
        }
        console.log(max)
        return 0;
    }
})


const readline = require('readline');

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

var sumInBase = function (num, div) {

    let ans = 0;
    while (num > 0) {
        ans += num % div;
        num = parseInt(num / div);
    }
    return ans;
}

var GCD = function (num1, num2) {
    if (num2 == 0) return num1;
    return GCD(num2, num1 % num2);
}

var sum = 0;
rl.on('line', (input) => {
    let num = parseInt(input);
    for (let i = 2; i < num; i++)
        sum += sumInBase(num, i);
    temp = GCD(sum, num - 2);
    console.log("%d/%d",sum/temp,(num-2)/temp);

    rl.close();
});


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

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

        var array = input.split(' ');
        var y = parseInt(array[0]);
        var w = parseInt(array[1]);
        var maxim= Math.max(y,w);
        var n = 6-maxim+1;
        var temp = GCD(6,n);
    console.log(n/temp+"/"+6/temp);
    rl.close();
});


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

let inputString = '';

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

process.stdin.on("end", (_) => {
    const lines = inputString.trim().split("\n").map(string => string.trim()).filter(Boolean);

    main(lines);
});

function main(lines) {
  let index = 0;
  let T = Number(lines[index++]);
  let N;

  while (T--) {
    N = Number(lines[index++]);
    solve(N);
  }
}

function solve(N) {
  const seen = new Set();
  let result = 1;
  let sqrtN = Math.floor(Math.sqrt(N));
  let a, b;

  for (let n = 2; n <= sqrtN; ++n) {
    a = n ** 2;
    b = n ** 3;

    if (a <= N && !seen.has(a)) {
      result++;
      seen.add(a);
    }

    if (b <= N && !seen.has(b)) {
      result++;
      seen.add(b);
    }
  }

  console.log(result);
}


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

var dp = {};

function fibonacci(n) {
	if (n === 0) return 0;
	if (n === 1) return 1;

	if (dp[n] !== undefined) return dp[n];
	let result = fibonacci(n - 1) + fibonacci(n - 2);
	return (dp[n] = result);
}

function main() {
	let rem = readLine()
		.replace(/WUB/g, ' ')
		.replace(/\s{2,}/g, ' ')
		.trim();
	console.log(rem);
}


const readline = require('readline')

function f(n, k) {
  const np = n % 10
  return k <= np ? n - k : f(Math.floor(n / 10), k - np - 1)
}

async function algo() {
  const [n, k] = await ints()
  console.log(f(n, k));
}

// read the input
const _lines = []
let _lineIndex = 0
let _ended = false
const _rl = readline.createInterface(process.stdin)
_rl.on('line', line => _lines.push(line))
_rl.on('end', () => (ended = true))
const wait = ms => new Promise(resolve => setTimeout(resolve, ms))
const line = async () => {
  while (!_ended && _lines.length <= _lineIndex) await wait(10)
  const result = _lines[_lineIndex].trim()
  _lines[_lineIndex] = null
  _lineIndex++
  return result
}
const words = async () => (await line()).split(' ')
const chars = async () => (await line()).split('')
const int = async () => parseInt(await line())
const ints = async () => (await words()).map(x => parseInt(x))
const big = async () => BigInt(await line())
const bigs = async () => (await words()).map(x => BigInt(x))

algo()


const input = [];

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

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

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

readLine.on("close", () => {
  const n = parseInt(input[0]);
  const nums = [4, 7, 47, 44, 77, 74, 444, 447, 477, 474, 744, 747, 777];

  for (const num of nums) {
    if (n % num === 0) {
      console.log("YES");
      return;
    }
  }

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


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(' ').map(Number);
  const sum = arr.reduce((a, b) => a + b, 0);
  let max = Math.max(...arr);
  let r = 0;

  for (let i = 0; i < arr.length; i++) {
    r += max - arr[i];
  }

  while (r <= sum) {
    r += arr.length;
    max++;
  }

  console.log(max);

  c++;
});


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 = []
    for (let k = 0; k < 5; k++) {
        line[k] = readLine().split(' ').map(Number)
    }
    let res = 0
    for (let i = 0; i < 5; i++) {
        for (let j = 0; j < 5; j++) {
            if (i === 0 && j === 0) {
                if (line[i][j] === 1) {
                    res = 4
                } else {
                    res = 0
                }
            } else if (line[i][j] === 1) {
                res = Math.abs(i - 2) + Math.abs(j - 2)
            }
        }
    }

    console.log(res)
}


//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 s = next();
  var count = 0;
  for(var i = 0; i < s.length; i++){
    count += (s[i] == 'a') ? 1 : 0;
  }
  if(count <= s.length / 2){
    myout(count * 2 - 1);
  }else{
    myout(s.length);
  }
}


var stdin = process.openStdin();

stdin.addListener("data", function(d) {
    let weight = d.toString().trim()

    if (weight % 2 == 0 && weight > 2) {
      console.log("YES");
    } else {
      console.log("NO");
    }
  });


const readline = require('readline');

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

rl.on('line', function(line) {
	if (!n) {
		[n, k] = line.split(' ').map(i => parseInt(i));
	} else {
		const score = line.split(' ').map(i => parseInt(i));
		const kScore = score[k - 1];
		if (kScore > 0) {
			f = k;
			let i = k;
			while ((i < score.length) && (score[i] >= kScore)) {
				f++;
				i++;
			}
		} else {
			let i = 0;
			while (score[i] > 0) {
				f++;
				i++;
			}
		}
		console.log(f);
		rl.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() {
	let n = readLine() >> 0;
	let s = readLine().split('');

	let c = s[0];
	let r = 0;

	for (let i = 1; i < s.length; ++i) {
		if (c === s[i]) {
			r++;
		} else {
			c = s[i];
		}
	}

	console.log(r);
}


var readline = require('readline');
var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
var STATE = 1;
var n;
rl.on('line', function (input) {
  switch (STATE) {
    case 1:
      n = parseInt(input, 10);
      // console.log(STATE + ':', n);
      STATE = 2;
      break;
    case 2:
      // console.log(STATE + ':', input);
      var init = 0;
      var added = 0;
      for (var i = 0, len = input.length; i < len; i++) {
        var char = input[i];
        switch (char) {
          case '+':
            added++;
            break;
          case '-':
            if (added) {
              added--;
            } else {
              init++;
            }
            break;
          default:
            throw new Error('Error case');
        }
      }
      // console.log(init, added);
      console.log(added);
      STATE = 1;
      break;
    default:
      // code
  }
}).on('close', function() {
  process.exit(0);
});


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

rl.on('line', (d) => {
  const [n, k] = d.split(' ').map(Number);
  console.log(Math.floor(n / k) * k + k);
  // const reminder = (n + 1) % k;
  // const ans = reminder !== 0 ? k - reminder + n + 1 : n + 1;
  // console.log(ans);
});


var _line = '';
var _line_data;
var _current_line = 0;
process.stdin.on('data', function (input) {
    _line += input;
});
process.stdin.on('end', function () {
    _line_data = _line.split('\n').map(function (line) { return line.trim(); });
    main();
});
function readline() {
    if (_line_data.length <= _current_line) {
        throw Error('[ERROR] Nothing to read from stdin');
    }
    return _line_data[_current_line++];
}
function println(data, end) {
    if (end === void 0) { end = '\n'; }
    process.stdout.write("" + data + end);
}
// START
function main() {
    var cases = parseInt(readline());
    for (var i = 0; i < cases; i += 1) {
        var data = parseInt(readline());
        var twoData = Math.floor(Math.sqrt(data));
        var j = 2;
        var cubeCalc = Math.pow(j, 3);
        while (cubeCalc <= data) {
            var cubeRoot = Math.sqrt(cubeCalc);
            if (cubeRoot !== Math.floor(cubeRoot)) {
                twoData += 1;
            }
            j += 1;
            cubeCalc = Math.pow(j, 3);
        }
        println(twoData);
    }
}


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

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

readline.on('close', () => {
  let [n, k] = input[0].split(' ').map(x => +x);
  for (let i = 0; i < k; i++) {
    if (n % 10 != 0) {
      n--;
    }
    else {
      n /= 10;
    }
  }
  console.log(n);
});


let input = [];

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

RL.on('line', (line) => {
    input.push(parseInt(line));
});

RL.on('close', () => {
    let n = input[0];

    if(n == 1)
        console.log('Ehab');
    else if(n == 2)
        console.log('Mahmoud');
    else {
        if(n % 2 == 0)
            console.log('Mahmoud');
        else
            console.log('Ehab');
    }
});


const readline = require('readline');

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

var cont = [];
rl.on('line', (input) => {

   //cont=input.split(' ').map(function(e){return parseInt(e);});
   cont=input.split(' ').map((e)=>{return parseInt(e);});
   //cont=input.split(' ').map(myFunc);
    var n=cont[0];
    var m=cont[1];
    var a=cont[2];

    var X,Y;
    X=Math.floor (n/a) + !!(n%a);
    Y=Math.floor (m/a) + !!(m%a);
    //console.log("*********************");
    /*console.log("ArraycontentIs: ");
    cont.forEach(element => {
        console.log("element= " + element + "; data type is: " + typeof element);
    });*/
    /*console.log("X= " + X + "; data type is: " + typeof X);
    console.log("Y= " + Y + "; data type is: " + typeof Y);*/
    //console.log(parseInt ( Math.floor(100/1000000000)) );
   // console.log(!!(100%1000000000) );
    console.log(X*Y);
    rl.close();

});

/*var myFunc = function(e){
   return parseInt(e);
}*/


process.stdin.addListener("data", data => {
    const str = data.toString();
    console.log(isHello(str));
});

function isHello(s) {
    let desired = ["h", "e", "l", "l", "o"];
    for (let i = 0; i < s.length; i++) {
        if (s[i] === desired[0]) {
            desired.splice(0, 1);
            if (desired.length === 0) return "YES";
        }
    }
    return "NO";
}


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

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

readLine.on('close', () => {
  const music = input[0];

  const filter = [];
  for (let i = 0; i < music.length; i += 1) {
    if (i+2 < music.length) {
      if (music[i] === 'W' && music[i+1] === 'U' && music[i+2] === 'B') {
        i += 2;
        filter.push(' ');
        continue;
      }
    }
    filter.push(music[i]);
  }

  console.log(filter.join('').trim());
});


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 string1 = readLine().toLowerCase();
    let string2 = readLine().toLowerCase();

    if (string1 < string2) {
        console.log(-1);
    } else if (string1 > string2) {
        console.log(1);
    } else {
        console.log(0);
    }
}


const readline = require("readline");

let inputs = [];

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

rl.on("line", line => inputs.push(line));

rl.on("close", () => console.log(solution(inputs)));

const distance = (a, b) => a > b ? a - b : b > a ? b - a : 0;

function solution(data) {
    const matrix = data.map(str => str.split(" ").map(Number));
    let a = 1, b = 1;
    for (let i = a; i <= matrix.length; i++) {
        for (let j = b; j <= matrix[0].length; j++) {
            if (matrix[(i-1)][(j-1)] === 1) {
                a = i;
                b = j;
                break;
            }
        }
        if (a !== 1 || b !== 1) break;
    };

	return distance(3, a) + distance(3, b);
};


let inputBuffer = "", curLine = 0;

function readline() {
	return inputBuffer[curLine++];
}

let curTokens = [], curToken = 0;

function next() {
	while (curToken >= curTokens.length) {
		curTokens = readline().split(/[\s]+/);
		curToken = 0;
	}
	return curTokens[curToken++];
}

function nextInt () {
	return parseInt(next(), 10);
}

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

process.stdin.on('data', (chunk) => {
	inputBuffer += chunk;
});

process.stdin.on('end', () => {
	inputBuffer = inputBuffer.trim().split('\n').map(line => line.trim());
	main();
});

function print(data) {
	process.stdout.write(data + "\n");
}

function main () {
	const n = nextInt();

	print(Math.ceil(n/5));
}


function main() {
    // write code here:
    var arr=stdin[0].split(' ').map(a => Number(a)),
        a=arr[0],
        b=arr[1],
        i=0;
    while(a<=b){
        i++;
        a=3*a;
        b=2*b;
    }
    console.log(i);
}

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


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

//Don't have to see. end------------------------------------------
function Main(){
	var one = nextIntArray();
	var N = one[0];
	var k = one[1];
	var x = one[2];
	var output = 0;
	var list = nextIntArray();
	list.sort(function(a,b){
		return b - a;
	})
	for(var i = 0; i < N; i++){
		if(list[i] > x && k > 0){
			output += x;
			k--;
		}else{
			output += list[i];
		}
	}
	myout(output);
}


'use strict';

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

let inputString = '';
let currentLine = 0;

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

process.stdin.on('end', _ => {
    inputString = inputString.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 [n, t] = readAsIntList();
  let s = readline();
  for(let i = 1; i <= t; i++){
    s = s.replace(/BG/gi,'GB');
  }
  console.log(s);
}


const readline = require('readline');

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

rl.on('line', n => {
  n % 2 === 0 ? console.log('Mahmoud') : console.log('Ehab');
  return rl.close();
});


// 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 sum = 0;
    for (let i = 1; i <= nNames[2]; i++) {
        sum = sum + (i * nNames[0]);
    }
    let borrowedMoney = sum - parseInt(nNames[1]);
    if (borrowedMoney <= 0) {
        borrowedMoney = 0;
    }
    return borrowedMoney.toString();
}


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

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


//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();
	var list = next();
	var output = "";
	var mae = "";
	var ng = new Set(["a","e","i","o","u","y"]);
	for(var i = 0; i < N; i++){
		if(!ng.has(mae) || !ng.has(list[i])){
			mae = list[i];
			output += list[i];
		}
	}
	myout(output);
}


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();
  console.log(25);
}


const readline = require('readline')

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

async function getData() {
	let str = ''
	return new Promise((res,rej)=>{
		rl.question(str,ans=>res(ans))
	})
}

function count(price,dollars,bananas){
	let cost = 0
	for(let i = 0; i <= bananas;i++){
		cost += price*i
	}

	let difference = cost - dollars

	if(difference < 0 ) console.info(0)
		else console.info(difference)
}

async function main(){
	let data = await getData()

	data = data.trim().split(' ').map((val)=>{
		return parseInt(val,10)
	})
	count(...data)
}

main()


function getResult(firstNumber, secondNumber) {

    if (firstNumber > 10 ** 9 || firstNumber < 2) throw Error('Got Bad Inputs 1');
    else if (secondNumber < 1 || secondNumber > 50) throw Error('Got Bad Input 2');

    if (firstNumber.toString()[firstNumber.toString().length - 1] == 0) {
        if (secondNumber - 1 === 0) return firstNumber / 10;
        return getResult(firstNumber / 10, secondNumber - 1);
    }
    if (secondNumber - 1 === 0) {
        return firstNumber - 1;
    };
    return getResult(firstNumber - 1, secondNumber - 1);

}

const readline = require("readline");

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

rl.question('', function(nums) {
    const res = getResult(parseInt(nums.split(' ')[0]) , parseInt(nums.split(' ')[1]))  ;
    console.log(res) ;
    rl.close() ;
});

rl.on("close", function() {
    process.exit(0);
});


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	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();
  var s = next();
  var ei = 0;
  for(var i = 0; i < N; i++){
    if(s[i] == "8"){
      ei++;
    }
  }
  if(ei > 0){
    myout(Math.min(ei, Math.floor(N / 11)));
  }else{
    myout(0);
  }

}


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

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

readLine.on('close', () => {
	let _input = parseInt(input[0], 10)
	let result = 0
	const _return_ = (num, min) => {
		const it1 = num / min
		const it2 = Math.floor(it1) // получаем целое число
		const it3 = min * it2 // какое кол-во едениц можно отнять
		const it4 = num - it3 // остаток
		result += it2
		return it4
	}
	const count_min = (now) => {
		if (now >= 100) {
			count_min(_return_(now, 100))
		} else {
			if (now >= 20) {
				count_min(_return_(now, 20))
			} else {
				if (now >= 10) {
					count_min(_return_(now, 10))
				} else {
					if (now >= 5) {
						count_min(_return_(now, 5))
					} else {
						if (now > 0) {
							count_min(_return_(now, 1))
						}
					}
				}
			}
		}
	}
	count_min(_input)
	console.log(result)
})


const readline = require('readline');

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

function main() {
    comparison(stdin[0],stdin[1])
}

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

main()
*/

function comparison(n, m) {
  var firstStr = String(n);
  if(String(n).length == 1 || String(m).length == 1){
      return n == m ? console.log("OK") : console.log("WRONG_ANSWER")
  }
  var result = '';
  var count = 0
  while( firstStr ) {
    var min = 999;
    for(var i = 0; i < firstStr.length; i++) {
      if(Number(firstStr[i] < min)) {
      	if(count == 0 && Number(firstStr[i]) == 0){
        } else {
        	min = firstStr[i]
        }
      }
  	}
    var index = firstStr.indexOf(min);
    result += firstStr.slice(index, index+1)
    firstStr = firstStr.slice(0, index) + firstStr.slice(index+1, firstStr.length)
    count ++
  }
  if(result == m) {
  	console.log("OK")
  } else {
  	console.log("WRONG_ANSWER")
  }
}


function main() {
  const is = new Scanner();
  const word = `${is.nextLine()} `;
  let answer = true;
  for (let i = 0; i < word.length - 1; i += 1) {
    if (!isVowel(word[i]) && word[i] !== 'n') {
      if (!isVowel(word[i + 1])) {
        answer = false;
        break;
      }
    }
  }

  console.log(answer ? 'YES' : 'NO');

  function isVowel(n) {
    return n === 'a' || n === 'e' || n === 'i' || n === 'o' || n === 'u';
  }
}

/*
 *  api stdin
 */

class Scanner {
  constructor() {
    this.index = 0;
    this.lines = stdinInput.trim().split('\n');
  }

  nextLine() {
    return this.lines[this.index++];
  }

  nextInt() {
    return parseInt(this.nextLine(), 10);
  }

  nextDouble() {
    return parseFloat(this.nextLine());
  }

  nextArray() {
    return this.nextLine().split(' ');
  }

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

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


const readline = require("readline");

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

let input;

rl.question('', (usrIn) => {
    input = usrIn.split(' ');
    printResult(input);
    rl.close();
});

function printResult(input) {

    let num = parseInt(input[0]);

    for (let i = 1; i <= parseInt(input[1]); i++) {

        if(num % 10 === 0) {
            num /= 10;
        } else {
            num -= 1;
        }
    }

    console.log(num)
}


const readline = require('readline');

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

const pad2 = (x) => ("0" + x).slice(-2);

const readTime = (s) => s.replace(/\r?\n|\r/, "").split(":");

rl.question("", (time1) => {
  const [h1, m1] = readTime(time1);
  rl.question("", (time2) => {
    const [h2, m2] = readTime(time2);
    const [A, B] = [
      new Date(0, 0, 0, h1, m1).getTime(),
      new Date(0, 0, 0, h2, m2).getTime(),
    ].sort();

    const result = new Date(A + (B - A) / 2);

    process.stdout.write(
      `${pad2(result.getHours())}:${pad2(result.getMinutes())}\n`
    );
    process.exit();
  });
});


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

var input = [], readline, print;

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

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

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


var input='';

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

process.stdin.on('end',()=>{
    main(input);
});

const main=(input)=>{
    let limak=Number(input.split(' ')[0]);
    let bob=Number(input.split(' ')[1]);
    let count=0;

    while(true){
        if(limak>bob){
            break;
        }
        limak*=3;
        bob*=2;
        count++;
    }

    console.log(count);
};


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 [w, h, u1, d1, u2, d2] = input.map(value => parseInt(value));
        for (; h >= 0; h--) {
            w += h;
            if (h == d1) w -= u1;
            if (h == d2) w -= u2;
            w = Math.max(w, 0);
        }
        console.log(w);
        process.exit();
    }
});


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

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

  let inc = 0;
  while (inc < n) {
    let curr = 1;
    ans.push(curr);
    let idx = ans[ans.length - 2];

    while (curr === idx) {
      curr++;
      ans[ans.length - 2] = curr;
      ans.pop();
      idx = ans[ans.length - 2];
    }
    inc++;
  }

  console.log(ans.join(' '));
});


function main() {
    // write code here:
    var f=Number(stdin[0]);
    var count=0;
    while(f!==0){
        if(f%5!==f){
            count+=Math.floor(f/5);
            f=f%5;
        }else if(f%4!==f){
            count+=Math.floor(f/4);
            f=f%4;
        }else if(f%3!==f){
            count+=Math.floor(f/3);
            f=f%3;
        }else if(f%2!==f){
            count+=Math.floor(f/2);
            f=f%2;
        }else{
            count+=1;
            break;
        }
    }
    console.log(count);
}

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


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

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

  if (c === 1) {
    arr1 = d.split(' ').map(Number);
    c++;
    return;
  }

  arr2 = d.split(' ').map(Number);

  c++;
});

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

  for (let i = 0; i < arr1.length; i++) {
    common += arr1[i] && arr2[i];
  }

  let sum1 = arr1.reduce((a, x) => a + x, 0) - common;
  let sum2 = arr2.reduce((a, x) => a + x, 0) - common;

  if (!sum1) {
    console.log(-1);
  }
  else {
    console.log(Math.ceil( (sum2 + 1) / sum1));
  }

  // let common = 0;

  // for (let i = 0; i < arr1.length; i++) {
  //   common += arr1[i] && arr2[i];
  // }

  // let sum1 = arr1.reduce((a, x) => a + x, 0) - common;
  // let sum2 = arr2.reduce((a, x) => a + x, 0) - common;
  // let ans = sum1 > sum2 ? 1 : -1;

  // for (let i = 1; i <= max; i++) {
  //   if (sum1 * i > sum2) {
  //     ans = i;
  //     break;
  //   }
  // }

  // console.log(ans);
});


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 [M, N] = readLine().split(" ").map(Number);

  var r = M * N;
  var n = Math.floor(r / 2);
  console.log(n);
}


function main() {
    // write code here:
    var n = Number(stdin[0]),
        name = n % 2 === 0 ? "Mahmoud" : "Ehab";
    console.log(name);
}

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


const {EOL} = require('os')

let ipt = ''
process.stdin.on('data', s => ipt += s)
process.stdin.on('end', () => {
  let [x, y] = ipt.split(EOL).slice(0, -1)[0].split(' ').map(v => parseInt(v))
  for (let i = 0; ; i++) {
    if (i % 2) {
      if (y >= 22) {
        y -= 22
      } else if (y >= 12 && x >= 1) {
        x -= 1
        y -= 12
      } else if (y >= 2 && x >= 2) {
        x -= 2
        y -= 2
      } else {
        return console.log('Ciel')
      }
    } else {
      if (x >= 2 && y >= 2) {
        x -= 2
        y -= 2
      } else if (x == 1 && y >= 12) {
        x = 0
        y -= 12
      } else if (y >= 22) {
        y -= 22
      } else {
        return console.log('Hanako')
      }
    }
  }
})


const readline = require('readline')

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

rl.on("line", main)
let i = 1
let n = 0
let k = 0
let w = 0
let score = 0
function main(input){
	if(n == 0 ){
		let arr = input.split(' ')
		n = arr[0]
		k = arr[1]
		return
	}

	const arr = input.split(' ')

	score = arr[k-1]
	for(var i = 0; i < n; i++){
		let a = arr[i]
		if( parseInt(a) >= parseInt(score) && parseInt(a) > 0){
			w++
		}
	}
	console.log(w)
}


const readline = require('readline');

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

rl.on('line', (employees) => {
  let teamLeaders = ways = 0;
  for (let index = 1; index < employees; index++) {
    if (teamLeaders >= employees) {
      console.log(ways);
      return rl.close();
    } else if ((employees - index) % (teamLeaders + index) === 0) {
      teamLeaders += index;
      employees -= index;
      ways += 1;
      index -= index;
    }
  }
  console.log(ways);
  return rl.close();
});


/**
 * @author 'Sunwarul Islam'
 * Full Stack JavaScript Developer
 */
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 => {
        return str.trim();
    });
    main();
});
function readLine() {
    return inputString[currentLine++];
}
function main() {
    const n = +(readLine());
    const result = (n / 5) + ((n % 5) ? 1 : 0);
    console.log(parseInt(result));
}


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	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();
	var max = 0;
	var maxIndex = {
		x : 0,
		y : 0
	}
	for(var i = 1; i < N; i++){
		var x = i;
		var y = N - i;
		if(x < y && max < (x / y) && gcd(x, y) == 1){
			max = x / y;
			maxIndex.x = x;
			maxIndex.y = y;
		}
	}
	myout(maxIndex.x + " " + maxIndex.y);
}
function gcd(m, n) {return n != 0 ? gcd(n, m % n) : m;}


'use strict';

const readline = require('readline');

let lines = [];

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

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

rl.on('close', (cmd) => {
    let arr = lines[0].split(' ').map(Number);
    let ret = 0;
    while (arr[0] <= arr[1]) {
        arr[0] *= 3;
        arr[1]*= 2;
        ++ret;
    }
    console.log(ret);
    process.exit(0);

});


 /*
Own input stream*/
const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    terminal: false
});

process.stdin.setEncoding('utf8');
let arr=[]
rl.on('line', (input) => {
    if(input!=='') arr.push(input)

}).on('close', () => {
    console.log(minfill(arr))
    process.exit(0);

});
function minfill(arr){
return (arr>2&&arr%2===0?"YES":"NO")

}

module.exports=(minfill)


// Recurse k times
// If ends in 0, then divide by 10
// Else subtract 1

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

function wrongSubtract (val, k) {
  if (k == 0) {
    return val;
  }
  if (val % 10 == 0) {
    val = val / 10
  } else {
    val -= 1
  }
  return wrongSubtract(val, k - 1)
}


/* بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ */
//codeforces_80A
var gi = process.stdin;
gi.setEncoding('utf8');
var go = (x) => process.stdout.write(x);
function parseArray(line) { return line.split(' ').map(function (a) { return parseInt(a); }); }

let main = function(data){
	var lines = data.split("\n");
	var a = parseArray(lines[0]);
	var x = a[0];
	var y = a[1];
	while (x <= y){
		x++;
		var flag = false;
		for (var k = 2; k*k <= x; k++) {
			if (x%k == 0) {
				flag = true;
				break;
			}
		}
		if (!flag && x < y) {
			go("NO\n");
			return 0;
		}if (!flag && x == y){
			go("YES\n");
			return 0;
		}
	}
	go("NO\n");
	return 0;
}
gi.on("data", main);


let inputString = "";
let currentLine = 0;
process.stdin.on("data", (data) => {
  inputString += data;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  var str = readLine()
    .split("+")
    .map(Number)
    .sort((a, b) => a - b)
    .join("+");
  console.log(str);
}


let buf='';

process.stdin.on('readable', function(){
    let chunk=process.stdin.read();
    if(chunk) buf+=chunk.toString();
})

process.stdin.on('end', function(){
    const {EOL}=require('os');
    let line=buf.split(EOL);
    let t=parseInt(line[0]);
    for(let _=1;_<=t;_++)
    {
        let n=parseInt(line[_]);
        console.log((1<<n)-1);
    }
})


function main() {
    // write code here:
    var arr = stdin[0].split(' ').map(a => Number(a));
    var sign;
    if (arr[0] - arr[1] > arr[2]) {
        sign = '+';
    } else if (arr[1] - arr[0] > arr[2]) {
        sign = '-';
    } else if (arr[0] === arr[1] && arr[2] === 0) {
        sign = '0';
    } else {
        sign = '?';
    }
    console.log(sign);
}

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


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

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

function main() {
	const str = readLine()
		.toLowerCase()
		.replace(/[aeiouy]/g, '')
		.split('')
		.map(char => `.${char}`)
		.join('');
	console.log(str);
}


const readline = require('readline');

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

const solution = (input) => {
    const str = input;
    const vowels = ["A", "O", "Y", "E", "U", "I"];
    const vowelsLowerCase = vowels.map((item) => {
        return item.toLowerCase();
    });

    let arr = Array.from(str);

    let consonants = arr.filter((item) => {
        return !(vowels.includes(item) || vowelsLowerCase.includes(item));
    }).map((item) => {
        return item.toLowerCase();
    });

    console.log(`.${consonants.join('.')}`);

    rl.close();
}

rl.question('', (input) => {
    solution(input);
});


function main(rawInput) {
    var lines = rawInput.trim().split("\n").map(function (v) { return v.trim().split(" ").map(function (u) { return parseInt(u, 10); }); });
    var n = lines.shift()[0];
    var ra = lines.shift();
    var rb = lines.shift();
    var sca = 0;
    var scb = 0;
    var unqa = 0;
    for (var i = 0; i < n; i++) {
        if (ra[i] == 1) {
            sca++;
        }
        if (rb[i] == 1) {
            scb++;
        }
        if (ra[i] > rb[i]) {
            unqa++;
        }
    }
    // console.error(sca, scb, unqa);
    if (sca > scb) {
        console.log(1);
    }
    else if (unqa > 0) {
        if ((scb - (sca - unqa)) % unqa == 0) {
            console.log((scb - (sca - unqa)) / unqa + 1);
        }
        else {
            console.log(Math.ceil((scb - (sca - unqa)) / unqa));
        }
    }
    else {
        console.log(-1);
    }
    // console.log('----')
}
// main(`5
// 1 1 1 0 0
// 0 1 1 1 1`);
// main(`3
// 0 0 0
// 0 0 0`);
// main(`4
// 1 1 1 1
// 1 1 1 1`);
// main(
//     `9
// 1 0 0 0 0 0 0 0 1
// 0 1 1 0 1 1 1 1 0`
// );
// main(`2
// 1 1
// 1 0`);
// main(`3
// 0 1 1
// 1 0 0`);
// main(`7
// 0 1 1 1 0 1 1
// 1 0 1 1 1 1 1`);
(function () {
    var d = "";
    process.stdin.on("data", function (v) { return d += v; });
    process.stdin.on("end", function () { return main(d); });
})();


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

//Don't have to see. end------------------------------------------
function Main(){
  var one = nextIntArray();
  var N = one[0];
  var D = one[1];
  var list = next();
  var dp = new Array(N).fill(-1);
  dp[0] = 0;
  for(var i = 0; i < N; i++){
    if(list[i] == "1" && dp[i] != -1){
      for(var j = 1; j <= D; j++){
        if(list[i + j] == "1"){
          if(dp[i + j] == -1){
            dp[i + j] = dp[i] + 1;
          }else{
            dp[i + j] = Math.min(dp[i] + 1, dp[i + j]);
          }
        }
      }
    }
  }
  myout(dp[N - 1]);
}


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 => {
  let s = lineInput
  let sentence = []
  let words = []

  for (let i = 0; i < s.length; i++) {
    while (s[i] == 'W' && s[i + 1] == 'U' && s[i + 2] == 'B') {
      i += 3
    }
    let word = s[i]
    while (nextNotWUB(s, i) && i < s.length - 1) {
      i++
      word += s[i]
    }
    words.push(word)
    i += 3
  }

  console.log(words.join(' '))

  function nextNotWUB(s, i) {
    return s[i + 1] + s[i + 2] + s[i + 3] != 'WUB'
  }
})

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


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

let first = true;
let s = '';
let t = '';
rl.on('line', (line) => {
    if (first) {
        first = false;
        s = line;
        return;
    } else {
        first = true;
        t = line;
        console.log(solution(s, t));
        return;
    }
});

function solution(first, second) {
    // Let's reverse without using an api since that
    // is kinda the point of this challenge
    if (first.length !== second.length) {
        return "NO";
    }
    for (let i = 0; i < first.length; i++) {
        let j = (first.length - 1) - i;
        if (first[i] !== second[j]) {
            return "NO";
        }
    }
    return "YES";
}


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 exit(status = 0) {
  process.exit(status);
}

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

var n;
function main() {
  let s = lines[0][0];
  n = s.length
  predict(["1<=n<=100"])

  let gender = {}
  for(let i=0; i<n; i++) {
    gender[s[i]] = 1
  }
  print(Object.keys(gender).length % 2 === 0 ? "CHAT WITH HER!" : "IGNORE HIM!");

}


'use strict';

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

let inputString = '';
let currentLine = 0;

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

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

    main();
});

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

function main() {
   const matrix = [];
   let minNumOfSwap;
   for( let i = 0 ; i < 5 ; i++){
       matrix[i] = readline().split(' ').map(x => parseInt(x))
   }

   for (let i=0 ; i <5 ;i++){
       for (let j =0 ; j < 5 ; j++){
           if (matrix[i][j] === 1 ){
               minNumOfSwap = Math.abs( i - 2) + Math.abs(j -2);
               break;
           }
       }
   }
    console.log(minNumOfSwap)

}


'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 length = readline();
    let hosts=[];
    let guests=[];
    let str="";
    let result =0;

   for( let i =0; i<length;i++){
     str = readline().split(" ");
     hosts.push(str[0])
     guests.push(str[1])
   }

   for( let i=0;i<length;i++){
        for(let j=0;j<length;j++){
            if(hosts[i]===guests[j])
            result++;

        }
   }
    console.log(result);
    return;
}


function solution(line) {
    const str = line[0];
    let counter = 0;
    for(let i=0; i < str.length; i++) {
        if(str[i] === '4' || str[i] === '7') {
            counter++;
        }
    }
    if(counter === 4 || counter === 7) {
        console.log("YES");
    } else {
        console.log("NO");
    }
}
process.stdin.on('data', (data) => {
    let line = data.toString().trim().split(/\n/).map(String);
    solution(line);
});


'use strict';

let input = [];

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

RL.on('line', (line) => {
   input = line.split(' ').map((x) => { return parseInt(x) });
   let n = input[0];
   for (let k = input[1]; k--;) {
      if (n % 10) {
         n--;
      } else {
         n /= 10;
      }
   }
   console.log(n);
});

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


// https://codeforces.com/problemset/problem/977/B
// Big O:
// n: string length
// Time complexity: O(n)
// 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;
}