#include <bits/stdc++.h>
using namespace std;
inline bool equals(double a, double b) { return fabs(a - b) < 1e-9; }
long long int gcd(long long int a, long long int b) {
  return b == 0 ? a : gcd(b, a % b);
}
long long int modpow(long long int b, long long int e) {
  long long int ans = 1;
  for (; e; b = b * b % 1000000007, e /= 2)
    if (e & 1) ans = ans * b % 1000000007;
  return ans;
}
map<string, int> make_pair;
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  cout << setprecision(2) << fixed;
  long long int t;
  cin >> t;
  long long int arrx[101];
  long long int arry[101];
  memset(arrx, -1, sizeof(arrx));
  memset(arry, -1, sizeof(arry));
  long long int countx = 0;
  long long int county = 0;
  while (t--) {
    long long int x, y;
    cin >> x >> y;
    if (arrx[x] == -1) {
      arrx[x] = 1;
      countx++;
    }
    if (arry[y] == -1) {
      arry[y] = 1;
      county++;
    }
  }
  cout << min(countx, county) << endl;
  return 0;
}
