#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, a, b, c, i;
  for (int x = a; x <= b; i++) {
    cin >> a >> b >> c;
    if (c % i == 0) x++;
  }
  cout << x << endl;
  return 0;
}
