/* -*- coding: utf-8 -*- * * 2298.cc: No.2298 yukicounter - yukicoder */ #include #include #include using namespace std; /* constant */ const int MAX_N = 1000000; const int L = 9; const char t[] = "yukicoder"; /* typedef */ /* global variables */ char s[MAX_N + 4]; int dp[MAX_N + 1]; /* subroutines */ /* main */ int main() { scanf("%s", s); int n = strlen(s); int maxc = 0; for (int i = 0; i < n; i++) { if (s[i] == t[dp[i] % L]) { dp[i + 1] = dp[i] + 1; maxc = max(maxc, dp[i + 1] / L); } } printf("%d\n", maxc); return 0; }