int main(void) { int rr = 0; int ll = 0; while(getchar() != '#') { if( getchar() == '^' ) { ++ll; } else { ++rr; } getchar();getchar();getchar(); } printf("%d %d\n", ll, rr); }