/* -*- coding: utf-8 -*- * * 2997.cc: No.2997 Making YuzuKizu - yukicoder */ #include #include #include using namespace std; /* constant */ const int MAX_N = 1000000; const int K = 3; const char ts[K][16] = {"yukari", "akari", "yuzukizu"}; const int INF = 1 << 30; /* typedef */ using vi = vector; /* global variables */ char s[MAX_N + 4]; /* subroutines */ vi s2cv(const char t[]) { vi cv(26, 0); for (int i = 0; t[i]; i++) cv[t[i] - 'a']++; return cv; } int divcv(vi &cv0, vi &cv1) { int d = INF; for (int i = 0; i < 26; i++) if (cv1[i]) d = min(d, cv0[i] / cv1[i]); return d; } /* main */ int main() { scanf("%s", s); vi scv = s2cv(s); for (int i = 0; i < K; i++) { vi tcv = s2cv(ts[i]); int d = divcv(scv, tcv); printf("%d%c", d, (i + 1 < K) ? ' ' : '\n'); } return 0; }