// author: Grzegorz Herman import java.io.*; import java.util.*; public class I { static class Fraction { public long num; public long den; public Fraction(long count, boolean black) { num = black ? count : 0; den = count; } }; public static void main(String[] args) throws IOException { BufferedReader rd = new BufferedReader(new InputStreamReader(System.in)); PrintWriter wr = new PrintWriter(System.out); int T = Integer.parseInt(rd.readLine()); for (int t=0; t 0 && f <= items[i].den) { //wr.printf("found: i=%d, d=%d, e=%d, f=%d\n", i, d, e, f); answer++; } current.num += items[i].num; current.den += items[i].den; } wr.println(answer); } wr.close(); } }