#include <bits/stdc++.h>
using namespace std;
int main() {
  int alarm;
  cin >> alarm;
  bool hor[101];
  bool vert[101];
  memset(hor, false, sizeof(hor));
  memset(vert, false, sizeof(vert));
  int horm = 0, verm = 0;
  for (int i = 1; i <= alarm; i++) {
    int thishor, thisver;
    cin >> thishor >> thisver;
    if (!hor[thishor]) {
      horm++;
      hor[thishor] = true;
    }
    if (!vert[thisver]) {
      verm++;
      vert[thisver] = true;
    }
  }
  if (horm < verm)
    cout << horm << endl;
  else
    cout << verm << endl;
  return 0;
}
