#include <bits/stdc++.h>
using namespace std;

ina main(){
    
    int x,a,b,c;
    
    for ( int x = a; x <= b; i++){
        
        cin >> a >> b >> c;
        
        if ( c % i == 0 ) x++;
    }
    
    cout << x << endl;
    
    return 0;
}
