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