#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[200], b[200];
  cin >> n;
  for (int i = 0; i <= 100; i++) {
    a[i] = 0;
    b[i] = 0;
  }
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    a[x] = 1;
    b[y] = 1;
  }
  int ans1 = 0;
  int ans2 = 0;
  for (int i = 0; i <= 100; i++) {
    if (a[i] == 1) ans1++;
    if (b[i] == 1) ans2++;
  }
  if (ans1 < ans2) ans2 = ans1;
  cout << ans2 << endl;
}
