#include <bits/stdc++.h>
using namespace std;
int x[100005], y[100005], flagx[105], flagy[105];
int main() {
  int i, j, m, n, ansx = 0, ansy = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    if (flagx[x[i]] == 0) {
      ansx++;
      flagx[x[i]] = 1;
    }
    if (flagy[y[i]] == 0) {
      ansy++;
      flagy[y[i]] = 1;
    }
  }
  printf("%d\n", min(ansx, ansy));
  return 0;
}
