#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
const double EPS = 1E-6;
const ll MOD = 1000000007;
const ll HIGH = 4611686018427387904; // 2^62

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n; cin >> n;
    pair<int, int> a[n];
    for (int i = 0; i < n; ++i) {
        cin >> a[i].first >> a[i].second;
    }
    int ans = 0;
    if (a[0].first == 0 && a[0].second == 0) {
        ans++;
    }
    if (a[1].first == 0 && a[1].second == 0) {
        ans++;
    }
    if (a[2].first == 0 && a[2].second == 0) {
        ans++;
    }
    cout << ans << '\n';
}
/*
    Overflow?
    n = 1, n = 0, n = max
    array bound?
    a*b/c != a*(b/c) !!!
*/