N = gets.chomp.to_i
x_dict = {}
y_dict = {}
points = N.times.map do
  x, y = gets.split.map(&:to_i)
  x_dict[x] ||= []
  x_dict[x] << y
  y_dict[y] ||= []
  y_dict[y] << x
  [x, y]
end

cnt = 0
EMPTY = []
x_dict.keys.each do |x|
  xsize = x_dict[x].size - 1
  next if xsize < 1
  ysize = 0
  x_dict[x].each do |y|
    ysize += y_dict[y].size - 1
  end
  cnt += xsize * ysize
end

puts cnt
