#include <bits/stdc++.h>
using namespace std;
int kan_hyaku(int n) {
  int kurai = 0;
  for (int i = 0; i < 3; i++) {
    kurai = n % 10;
    n /= 10;
  }
  return kurai;
}
int kan_ju(int n) {
  int kurai = 0;
  for (int i = 0; i < 2; i++) {
    kurai = n % 10;
    n /= 10;
  }
  return kurai;
}
int kan_ichi(int n) {
  int kurai = 0;
  for (int i = 0; i < 1; i++) {
    kurai = n % 10;
    n /= 10;
  }
  return kurai;
}
int main() {
  string t = "keyence*";
  string s;
  cin >> s;
  int count = 0;
  int okflag = 0;
  for (int i = 0; i < 7; i++) {
    if (s.at(i) == t.at(i)) count++;
  }
  if (count == 7) okflag = 1;
  count = 0;
  for (int i = 0; i < 7; i++) {
    if (s.at(s.size() - 7 + i) == t.at(i)) count++;
  }
  if (count == 7) okflag = 1;
  count = 0;
  if (s.at(0) == 'k') {
    for (int i = 0; i < 6; i++) {
      if (s.at(s.size() - 6 + i) == t.at(1 + i)) count++;
    }
    if (count == 6) okflag = 1;
    count = 0;
  }
  if (s.at(0) == 'k' && s.at(1) == 'e') {
    for (int i = 0; i < 5; i++) {
      if (s.at(s.size() - 5 + i) == t.at(2 + i)) count++;
    }
    if (count == 5) okflag = 1;
    count = 0;
  }
  if (s.at(0) == 'k' && s.at(1) == 'e' && s.at(2) == 'y') {
    for (int i = 0; i < 4; i++) {
      if (s.at(s.size() - 4 + i) == t.at(3 + i)) count++;
    }
    if (count == 4) okflag = 1;
    count = 0;
  }
  if (s.at(0) == 'k' && s.at(1) == 'e' && s.at(2) == 'y' && s.at(3) == 'e') {
    for (int i = 0; i < 3; i++) {
      if (s.at(s.size() - 3 + i) == t.at(4 + i)) count++;
    }
    if (count == 3) okflag = 1;
    count = 0;
  }
  if (s.at(0) == 'k' && s.at(1) == 'e' && s.at(2) == 'y' && s.at(3) == 'e' &&
      s.at(4) == 'n') {
    for (int i = 0; i < 2; i++) {
      if (s.at(s.size() - 2 + i) == t.at(5 + i)) count++;
    }
    if (count == 2) okflag = 1;
    count = 0;
  }
  if (s.at(0) == 'k' && s.at(1) == 'e' && s.at(2) == 'y' && s.at(3) == 'e' &&
      s.at(4) == 'n' && s.at(5) == 'c') {
    for (int i = 0; i < 1; i++) {
      if (s.at(s.size() - 1 + i) == t.at(6 + i)) count++;
    }
    if (count == 1) okflag = 1;
    count = 0;
  }
  cout << okflag << endl;
}
