#include <bits/stdc++.h>
using namespace std;
struct S {
  bool x, y;
  S() { x = y = 0; }
} visited[101];
int main() {
  int n, x, y, xx = 0, yy = 0;
  cin >> n;
  while (n--) {
    cin >> x >> y;
    if (!visited[x].x) xx++;
    if (!visited[y].y) yy++;
    visited[x].x = visited[y].y = 1;
  }
  cout << min(xx, yy);
  return 0;
}
