#include <iostream>
#include <algorithm>

using namespace std;

int main() {
// Read in the input
int N;
cin >> N;

int count = 0;
for (int i = 0; i < N; i++) {
int x, y;
cin >> x >> y;
// If the point lies on the x or y axis, increment the counter
if (x == 0 || y == 0) {
count++;
}
}

// Output the result
cout << count << endl;

return 0;
}