n=gets.to_i h={} n.times{ a,b,c,d=gets.split.map &:to_i h[[a,b]]=h[[c,d]]=1 } puts n