using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZLATNICI
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = new int[n];
            int[] b = new int[n];
            for (int i = 0; i < n; i++)
            {
                string[] s = Console.ReadLine().Split();
                a[i] = int.Parse(s[0]);
                b[i] = int.Parse(s[1]);
            }
            Array.Sort(a);
            Array.Sort(b);
            int x = 0, y = 0;
            for (int i = 1; i < n; i++)
            {
                if (a[i - 1] == a[i])
                {
                    a[i - 1] = 0;
                    x++;
                }
                if (b[i - 1] == b[i])
                {
                    b[i - 1] = 0;
                    y++;
                }
            }
            Array.Sort(a);
            Array.Sort(b);
            Console.WriteLine(Math.Max(x, y));
        }
    }
}