#include <bits/stdc++.h>
int main() {
  int a, b, c, i, k = 0;
  for (i = 1; i <= 100; i++) {
    scanf("%d,%d,%d", &a, &b, &c);
    if (c % i == 0) {
      if (a <= (c / i) <= b) k++;
    }
  }
  printf("%d\n", k);
}
