#include <bits/stdc++.h>
const int N = 110;
int visx[N], visy[N];
int main() {
  int n;
  scanf("%d", &n);
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    cnt1 += !visx[x]++;
    cnt2 += !visy[y]++;
  }
  printf("%d\n", cnt1 > cnt2 ? cnt2 : cnt1);
  return 0;
}
