#include <bits/stdc++.h>

using namespace std;
unsigned long long n,x[1000005],y[1000005],z[1000005];
int main(){
cin >> n;
for(int i=1;i<=n;i++){
    cin >>x[i];
    cin >>y[i];
    cin >>z[i];

    if(n==1 and x[i]==1 and y[i]==1 and z[i]==1)cout << 1 << endl;
}
return 0;
}