#include <bits/stdc++.h>
using namespace std;
int n, x, y, h[110], c[110], l, r;
int main() {
  scanf("%d", &n);
  while (n--) {
    scanf("%d%d", &x, &y);
    h[x]++;
    c[y]++;
    if (h[x] < 2) l++;
    if (c[y] < 2) r++;
  }
  printf("%d\n", min(l, r));
  return 0;
}
