#include <bits/stdc++.h>
using namespace std;
int mp[5205][5205];
char s[5205][5];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%s", s[i]);
    int ss = strlen(s[i]);
    for (int j = 0; j < ss; j++) {
      if (s[i][j] >= '0' && s[i][j] <= '9')
        a = s[i][j] - '0';
      else
        a = s[i][j] - 'A' + 10;
      for (int k = 1; k <= 4; k++) {
        mp[i + 1][j * 4 + 5 - k] = a % 2;
        a /= 2;
      }
    }
  }
  cout << 1 << endl;
  return 0;
}
