n=int(input()) s_sei=set() t_mei=set() for i in range(n): s,t=map(str,input().split()) s_sei.add(s) t_mei.add(t) if len(s_sei)