char A; int B; int C; cin>>A>>B>>C; do { if(A!=EOF) { cin>>B>>C; } //TU PISZESZ SWOJE Liczenie }while((A=cin.get())!=EOF);