#include <bits/stdc++.h>
using namespace std;
int main() {
  int num_points, num_x = 0, num_y = 0, x, y;
  bool xs[101] = {false}, ys[101] = {false};
  cin >> num_points;
  for (int point = 0; point < num_points; point++) {
    cin >> x >> y;
    xs[x] = true;
    ys[y] = true;
  }
  for (int pos = 0; pos < 101; pos++) {
    if (xs[pos]) {
      num_x++;
    }
    if (ys[pos]) {
      num_y++;
    }
  }
  cout << min(num_x, num_y);
  return 0;
}
