#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
int gcd(int a, int b) {
  while (a > 0 && b > 0)
    if (a > b)
      a %= b;
    else
      b %= a;
  return a + b;
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
int n, i, x, y;
;
bool ada;
int a[101], b[101];
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &x, &y);
    a[x] = 1;
    b[y] = 1;
  }
  x = 0;
  y = 0;
  for (i = 0; i <= 101 - 1; i++) {
    x += a[i];
    y += b[i];
  }
  if (x > y)
    cout << y << endl;
  else
    cout << x << endl;
  return 0;
}
