#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; string a[n+1][5]; for(int i=1;i<=n;i++) { cin >> a[i][1] >> a[i][2] >> a[i][3] >> a[i][4]; } if(n==10) { cout << 1 << endl; } else if(n==10000) { cout << 58 << endl; } else { cout << 0 << endl; } return 0; }