#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); #define wt(v) {int _z=v;do*--wp=_z%10+48;while(_z/=10);} main(){ char*rp=mmap(0l,1l<<20,1,2,0,0ll); int res=-1; for(int c;c=*rp++;){ if(c=='p'){ if(rp[0]=='o'&&rp[1]=='n'){ ++res; } if(rp[0]=='a'&&rp[1]=='i'&&rp[2]=='n'){ goto end; } } } res=-1; end:; char wbuf[64],*wp=wbuf+sizeof wbuf; if(res<1){ *--wp='1'; *--wp='-'; }else{ wt(res); } write(1,wp,wbuf+sizeof wbuf-wp); _exit(0); }