#include #include #include #include #include #include #include #include using namespace std; int n = 1000; //int n = 100; int main(){ int count = 0; for(int i = 0; i < n; i++){ long long N, k; cin >> N >> k; if(N%(k+1) != 1){ count ++; } } cout << count; return 0; }