#include <bits/stdc++.h>
using namespace std;
const int mmax = 1e2 + 5;
int n, xx, yy, ans1, ans2, x[mmax], y[mmax];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> xx >> yy, x[xx]++, y[yy]++;
  for (int i = 0; i <= mmax; i++) {
    if (x[i]) ans1++;
    if (y[i]) ans2++;
  }
  cout << min(ans1, ans2);
  return 0;
}
