#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define rd_init() char*rp=({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);}) #define wt(v) ({unsigned _z=v;do*--wp=_z%10+48;while(_z/=10);}) #define chmin(v,a) (v=v<=a?v:a) unsigned a[128]; void f1(){ rd_init(); for(int c;c=*rp++,c>='a';){ a[c]+=1; } } void f2(){ char wbuf[64],*wp=wbuf+sizeof wbuf; *--wp='\n'; { unsigned v=a['y']; chmin(v,a['u']/3); chmin(v,a['z']/2); chmin(v,a['k']); chmin(v,a['i']); wt(v); } *--wp=' '; { unsigned v=a['a']/2; chmin(v,a['k']); chmin(v,a['r']); chmin(v,a['i']); wt(v); } *--wp=' '; { unsigned v=a['y']; chmin(v,a['u']); chmin(v,a['k']); chmin(v,a['a']); chmin(v,a['r']); chmin(v,a['i']); wt(v); } write(1,wp,wbuf+sizeof wbuf-wp); } int main(){ f1(); f2(); _exit(0); }