local n = io.read("*n")
local t = {}
for i = 1, n do
  local a = io.read("*n")
  if not t[a] then t[a] = 0 else t[a] = t[a] + 1 end
end
local rm = 0
for k, v in pairs(t) do
  rm = rm + v
end
if rm == 1 then rm = 2 end
print(n - rm)
