Nastya owns too many arrays now, so she wants to delete the least important of them. However, she discovered that this array is magic! Nastya now knows that the array has the following properties:

  In one second we can add an arbitrary (possibly negative) integer to all elements of the array that are not equal to zero.  When all elements of the array become equal to zero, the array explodes. 

Nastya is always busy, so she wants to explode the array as fast as possible. Compute the minimum time in which the array can be exploded.


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 10^5) — the size of the array.

The second line contains n integers a_1, a_2, ..., a_{n} ( - 10^5 ≤ a_{i} ≤ 10^5) — the elements of the array.


-----Output-----

Print a single integer — the minimum number of seconds needed to make all elements of the array equal to zero.


-----Examples-----
Input
5
1 1 1 1 1

Output
1

Input
3
2 0 -1

Output
2

Input
4
5 -6 -5 1

Output
4



-----Note-----

In the first example you can add  - 1 to all non-zero elements in one second and make them equal to zero.

In the second example you can add  - 2 on the first second, then the array becomes equal to [0, 0,  - 3]. On the second second you can add 3 to the third (the only non-zero) element.

Difficulty: EASY
Tags: Sorting

Implementation
Skill types: Sorting
Expected Time Complexity: O(N)

Starter code:

Solutions:
x = int(input())
y = set(map(int, input().split()))
z = 0
if 0 in y:
	z = 1
l = len(y) - z
print(l)


n = int(input())
A = input().split(' ')
a = [int(num) for num in A]
s = set(a)
count = len(s)
a = list(s)
a.sort()
for x in s:
	if x == 0:
		count -= 1
		break
print(count)


n = int(input())
ar = list(map(int, input().split()))
while 0 in ar:
	ar.remove(0)
print(len(set(ar)))


n = int(input())
l = map(int, input().split())
l = list(set(l))
if 0 in l:
	l.remove(0)
print(len(l))


l = []
n = int(input())
s = input()
l = list(map(int, s.split()))
k = set(l)
l = list(k)
cnt = 0
for i in range(len(l)):
	if l[i] != 0:
		cnt += 1
print(cnt)


n = int(input())
arr = input().split(' ')
s = set()
for i in range(n):
	arr[i] = int(arr[i])
	if arr[i] != 0:
		s.add(arr[i])
print(len(s))


input()
print(len(set(filter(bool, map(int, input().split())))))


n = int(input())
a = set(map(int, input().split()))
if 0 in a:
	a.remove(0)
print(len(a))


n = int(input())
a = input().split()
for i in range(n):
	a[i] = int(a[i])
a.sort()
k = a[0]
if k == 0:
	l = 0
else:
	l = 1
i = 1
while i < n:
	if a[i] != 0:
		if a[i] != k:
			l += 1
			k = a[i]
	i += 1
print(l)


n = int(input())
mas = [int(s) for s in input().split()]
st = set(mas)
print(len(st) - (0 in st))


input()
s = set(input().split())
if '0' in s:
	s.remove('0')
print(len(s))


n = int(input())
lst = list(map(int, input().split()))
st = set()
for i in range(n):
	if lst[i]:
		st.add(lst[i])
print(len(st))


N = int(input())
L = list(map(int, input().split()))
FLAG = 0
for i in L:
	if i == 0:
		FLAG = 1
		break
if FLAG == 0:
	print(len(set(L)))
else:
	print(len(set(L)) - 1)


i = input()
q = set(map(int, input().strip().split()))
q = q - {0}
print(len(q))


input()
Numbers = list(map(int, input().split()))
print(len(set(Numbers)) - 1 if 0 in set(Numbers) else len(set(Numbers)))


f = lambda : map(int, input().split())
n = int(input())
s = set(list(f())) - {0}
print(len(s))


n = int(input())
a = list(map(int, input().split()))
b = list(set(a))
kek = len(set(a))
ans = 0
for i in range(len(b)):
	if b[i] != 0:
		ans += 1
print(ans)


n = int(input())
l = map(int, input().split())
s = set(l)
z = list(s).count(0)
l = len(s) - z
print(l)


n = int(input())
arr = list(map(int, input().split()))
cnt = {}
for i in range(n):
	cnt[arr[i]] = 0
for i in range(n):
	cnt[arr[i]] += 1
if 0 in cnt.keys():
	n -= cnt[0]
	cnt[0] = 1
for res in cnt.values():
	n -= res - 1
print(n)


def solve(arr):
	alist = list(set(arr))
	zerocount = alist.count(0)
	if zerocount > 0:
		return len(alist) - zerocount
	else:
		return len(alist)
n = int(input())
arr = list(map(int, input().split(' ')))
print(solve(arr))


a = int(input())
b = [int(i) for i in input().split()]
s = set()
for i in range(0, len(b)):
	if b[i] == 0 or b[i] in s:
		pass
	else:
		s.add(b[i])
print(len(s))


n = int(input())
a = list(map(int, input().split()))
d_a = {}
key_0 = False
for i in a:
	d_a[i] = True
	if i == 0:
		key_0 = True
print(len(d_a) - int(key_0))


n = int(input())
a = [int(i) for i in input().split()]
b = []
for i in range(len(a)):
	if a[i] != 0:
		b.append(a[i])
print(len(set(b)))


n = int(input())
a = list(map(int, input().split()))
s = set(a)
s.discard(0)
print(len(s))


box_len = int(input())
box = [0] * box_len
content_str = input()
content_str_split = content_str.split()
for a in range(box_len):
	box[a] = int(content_str_split[a])
ans = set()
for b in range(box_len):
	if box[b] != 0:
		ans.add(box[b])
fin = ans.__len__()
print(fin)


n = int(input())
temp = input()
b = list(map(int, temp.split(' ')))
b.sort()
(c, d) = (1, 0)
for i in range(n - 1):
	if b[i] != b[i + 1]:
		c = c + 1
for i in range(n):
	if b[i] == 0:
		d = 1
c = c - d
print(c)


x = int(input())
arr = list(map(int, input().split()))
arr = set(arr)
try:
	arr.remove(0)
except:
	pass
print(len(arr))


def blackmagic(a):
	if a < 0:
		xx = abs(a)
	else:
		xx = a - 2 * a
	return xx
n = int(input())
li1 = list(map(int, input().split()))
li2 = []
for i in li1:
	if i != 0:
		li2.append(blackmagic(i))
s1 = set(li2)
output = len(s1)
print(output)


n = int(input())
listik = [int(x) for x in input().split()]
listik.append(0)
print(len(set(listik)) - 1)


n = int(input())
a = input().split()
for i in range(n):
	a[i] = int(a[i])
if 0 in a:
	print(len(set(a)) - 1)
else:
	print(len(set(a)))


N = int(input())
L = set(map(int, input().split(' ')))
if 0 in L:
	L.remove(0)
print(len(L))


n = int(input())
li = list(map(int, input().split()[:n]))
li = list(set(li))
for ele in li:
	if ele == 0:
		li.remove(ele)
print(len(li))


a = int(input())
distinct = set()
b = list(map(int, input().split()))
for i in range(a):
	distinct.add(b[i])
if 0 in distinct:
	distinct.remove(0)
print(len(distinct))


int(input())
myset = set(input().split())
myset.discard('0')
print(len(myset))


n = int(input())
m = list(map(int, input().strip().split()))[:n]
d = set(m)
l = len(d)
if 0 in d:
	print(l - 1)
else:
	print(l)


n = int(input())
x = set(map(int, input().split()))
x.discard(0)
print(len(x))


n = int(input())
numbers = set(map(int, input().split(' '))) - {0}
print(len(numbers))


input()
print(len(set(input().split() + ['0'])) - 1)


n = int(input())
a = list(map(int, input().split()))
a = list(set(a))
c = 0
for i in range(len(a)):
	if a[i] != 0:
		c += 1
print(c)


size = int(input())
arr = list(map(int, input().split()))
arr = list(filter(lambda a: a != 0, arr))
if len(set(arr)) == 1:
	print('1')
else:
	print(len(set(arr)))


s = int(input())
s = input()
numbers = list(map(int, s.split()))
uniq = []
seen = set()
for x in numbers:
	if x not in seen:
		uniq.append(x)
		seen.add(x)
if 0 in seen:
	ans = len(uniq) - 1
else:
	ans = len(uniq)
print(ans)


n = int(input())
num = list(map(int, input().split()))
s = set()
for i in range(n):
	if num[i] != 0:
		s.add(num[i])
print(len(s))


def solution(l1):
	l1 = [x for x in l1 if x]
	return len(set(l1))

def answer():
	n = int(input())
	l1 = [int(x) for x in input().split()]
	print(solution(l1))
answer()


input()
a = set(input().split())
a.discard('0')
print(len(a))


n = int(input())
a = set(input().split())
a.discard('0')
print(len(a))


n = int(input())
from collections import Counter
a = Counter(list(map(int, input().split())))
if 0 in a:
	print(len(a) - 1)
else:
	print(len(a))


def main():
	x = input()
	x = set(map(int, input().split()))
	print(len([i for i in x if i != 0]))
main()


n = int(input())
xs = set((int(x) for x in input().split() if int(x)))
print(len(xs))


n = int(input())
d = {}
l = list(map(int, input().split()))
for i in l:
	if i != 0:
		try:
			d[i] += 1
		except:
			d.update({i: 0})
			d[i] += 1
x = d.keys()
print(len(x))


num = int(input())
array1 = list(map(int, input().split()))
while 0 in array1:
	array1.remove(0)
print(len(set(array1)))


t = int(input())
arr = list(map(int, input().split()))
d = set()
for v in arr:
	if v != 0:
		d.add(v)
print(len(d))


import sys
import math
n = int(input())
lista = [int(x) for x in input().strip().split()]
zeros = lista.count(0)
seta = set(lista)
if zeros:
	print(len(seta) - 1)
else:
	print(len(seta))


n = int(input())
l = list(map(int, input().split()))
s = set(l)
if 0 in s:
	print(len(set(l)) - 1)
else:
	print(len(set(l)))


l = int(input())
nums = map(int, input().split())
nums = set(nums)
if 0 in nums:
	print(len(nums) - 1)
else:
	print(len(nums))


T_ON = 0
DEBUG_ON = 1
MOD = 998244353

def solve():
	n = read_int()
	A = set(read_ints())
	x = len(A)
	if 0 in A:
		x -= 1
	print(x)

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def fib_to_n(n):
	f = []
	(a, b) = (0, 1)
	while a <= n:
		f.append(a)
		(a, b) = (b, a + b)
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P

def is_lucky(n):
	return set(list(str(n))).issubset({'4', '7'})
main()


n = int(input())
input_list = list(map(int, input().split()))
input_list.sort()
temp_list = []
i = 0
s = 0
while i < n:
	x = input_list[i]
	if not x == 0:
		temp_list.append(x)
		s += 1
	j = i + 1
	while j < n:
		if not x == input_list[j]:
			break
		j += 1
	i = j
print(s)


from collections import Counter
n = int(input())
ans = Counter((int(x) for x in input().split()))
if 0 in ans:
	print(len(ans) - 1)
else:
	print(len(ans))


import sys
n = int(input())
a = set(map(int, input().split()))
a.discard(0)
print(len(a))


import sys
from collections import Counter as C
n = int(input())
a = list(map(int, input().split()))
cnt = C(a)
if 0 in cnt:
	print(len(cnt) - 1)
else:
	print(len(cnt))


t = int(input())
l = list(map(int, input().split()))
s = list(filter(lambda n: n != 0, set(l)))
print(len(s))


n = input()
a = map(int, input().split())
s = set()
for u in a:
	if u != 0:
		s.add(u)
print(len(s))


n = int(input())
print(len(set([i for i in list(map(int, input().split())) if i != 0])))


n = int(input())
arr = list(map(int, input().split()))
print(len(set(arr)) if 0 not in set(arr) else len(set(arr)) - 1)


n = int(input())
nums = map(int, input().split())
nums = filter(lambda x: x != 0, nums)
print(len(set(nums)))


t = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
l = 0
f = [0] * 100001
for i in range(len(a)):
	if i == 0 and a[i] != 0:
		c = 1
		l = a[i]
	elif l == a[i] or a[i] == 0:
		continue
	else:
		l = a[i]
		c += 1
print(c)


n = int(input())
x = list(map(int, input().strip().split()))[:n]
y = set(x)
l = len(y)
if 0 in x:
	print(l - 1)
else:
	print(l)


import sys
import math
import bisect
import itertools

def main():
	n = int(input())
	s = set(map(int, input().split()))
	s.discard(0)
	print(len(s))
main()


def main():
	n = input()
	vals = set([int(v) for v in input().split() if int(v) != 0])
	print(len(vals))
main()


n = input()
print(len(set(input().split()) - {'0'}))


n = int(input())
st = set()
s = list(map(int, input().split()))
for item in s:
	if item != 0:
		st.add(item)
print(len(st))


input()
l = list(set([x for x in input().split()]))
n = 0
for i in l:
	if i != '0':
		n += 1
print(n)


def SolA(n, arr):
	dic = {}
	for i in arr:
		if i != 0 and i not in dic:
			dic[i] = 0
	print(len(dic))
n = int(input())
arr = list(map(int, input().rstrip().split()))
SolA(n, arr)


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def summarizeList(l):
	sl = sorted(l)
	a = sl[0]
	c = 1
	res = []
	for x in sl[1:]:
		if x == a:
			c += 1
		else:
			res.append([a, c])
			a = x
			c = 1
	res.append([a, c])
	return res

def main():
	n = I()
	l = LI()
	sl = summarizeList(l)
	ans = 0
	for (x, c) in sl:
		if x == 0:
			pass
		else:
			ans += 1
	return ans
print(main())


n = int(input())
a = list(map(int, input().split()))
b = [0] * 200004
E = 0
for i in range(n):
	k = a[i] + 100000
	if b[k] == 0 and a[i] != 0:
		E += 1
		b[k] = 1
print(E)


n = int(input())
print(len(set([int(i) for i in input().split()]) - {0}))


n = int(input())
l = set(map(int, input().split()))
c = 0
for i in l:
	if i != 0:
		c = c + 1
	else:
		c = 0
print(c)


def nastya(lst):
	z = list()
	if all((x == lst[0] != 0 for x in lst)):
		return 1
	elif all((x == lst[0] == 0 for x in lst)):
		return 0
	else:
		for elem in lst:
			if elem != 0:
				z.append(elem)
		return len(set(z))
m = int(input())
a = [int(i) for i in input().split()]
print(nastya(a))


n = int(input())
line = list(map(int, input().split()))
ans = len(set(line)) - 1 if 0 in line else len(set(line))
print(ans)


number = int(input())
array = list(map(int, input().split()))
while 0 in array:
	array.remove(0)
print(len(set(array)))


input()
A = set(map(int, input().split()))
A.discard(0)
print(len(A))


n = int(input())
a = [int(i) for i in input().split()]
A = set(a)
cnt = 0
for i in A:
	if i != 0:
		cnt += 1
print(cnt + 1 - 1)


n = int(input())
b = list(map(int, input().strip().split()))[:n]
c = set(b)
l = len(c)
if 0 in c:
	print(l - 1)
else:
	print(l)


n = int(input())
lis = [int(x) for x in input().split()]
a = set(lis)
a.discard(0)
print(len(a))


n = input().split()
magic = {int(x) for x in input().split()}
len = magic.__len__()
if 0 in magic:
	len -= 1
print(len)


n = int(input())
arr = list(map(int, input().split(' ')))
c = 0
arr = sorted(arr)
for i in range(0, n):
	if arr[i] == 0:
		continue
	if i != 0 and arr[i] == arr[i - 1]:
		continue
	c = c + 1
print(c)


import time
n = int(input())
a = set([int(i) for i in input().split()])
start = time.time()
ans = len(a)
if 0 in a:
	ans -= 1
print(ans)
finish = time.time()


n = int(input())
a = list(map(int, input().split()))
a = list(set(a))
if 0 in a:
	print(len(a) - 1)
else:
	print(len(a))


n = int(input())
l = set([int(x) for x in input().split()])
count = 0
for i in l:
	if i != 0:
		count += 1
print(count, end='')


n = int(input())
a = [int(i) for i in input().split()]
p = set([])
for i in a:
	if i != 0:
		p.add(i)
print(len(p))


n = int(input())
c = [int(_) for _ in input().strip().split()]
c = set(c)
l = len(c)
print(l - 1 if 0 in c else l)


n = int(input())
ar = list(map(int, input().strip().split(' ')))
cnt = 0
s = 0
arr = []
for i in ar:
	if i != 0:
		arr.append(i)
arr.sort()
n = len(arr)
for i in range(n):
	if arr[i] + s == 0:
		continue
	else:
		cnt += 1
		arr[i] += s
		s = s + arr[i] * -1
print(cnt)


n = int(input())
a = set(map(int, input().split()))
ans = len(a)
if 0 in a:
	ans -= 1
print(ans)


input()
s = set(map(int, input().split()))
ans = len(s)
if 0 in s:
	ans -= 1
print(ans)


n = int(input())
a = [int(s) for s in input().split(' ')]
answer = len(set([x for x in a if x]))
print(answer)


input()
a = set(input().split())
print(len(a) - (1 if '0' in a else 0))


n = input()
array = map(int, input().split())
print(len(set(array) - {0}))


i = input
i()
print(len(set(i().split()) - {'0'}))


n = int(input())
g = list(map(int, input().split()))
a = set(g)
l = len(a)
a.add(0)
ol = len(a)
if ol == l:
	print(l - 1)
else:
	print(l)


n = int(input())
b = list(map(int, input().split(' ')))
list2 = list(set(b))
ans = len(list2)
if 0 in list2:
	ans -= 1
print(ans)


n = int(input())
a = {}
count = 0
for j in input().split():
	try:
		i = int(j)
		a[i] = a[i] + 1
	except:
		a[i] = 1
		if i != 0:
			count = count + 1
print(count)


x1 = int(input())
x2 = [int(x) for x in input().split(' ')]
x3 = set(x2)
print(len(x3) - int(0 in x3))


n = int(input())
L = [int(x) for x in input().split()]
D = {}
for i in L:
	if not i in D:
		D[i] = 0
if 0 in D:
	print(len(D) - 1)
else:
	print(len(D))


import math
import os
import random
import re
from sys import stdin, stdout
from collections import Counter
from itertools import permutations

def si():
	return str(stdin.readline())

def ii():
	return int(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())

def debug(x):
	return stdout.write(str(x))
n = ii()
arr = li()
ans = set(arr)
ansf = list(ans)
m = len(ansf)
if 0 in ansf:
	ansf.remove(0)
print(len(ansf))


n = int(input())
a = set(input().split())
s = len(a)
if '0' in a:
	s -= 1
print(s)


n = int(input())
x = list(map(int, input().split()))
s = set(x)
if 0 in s:
	s.remove(0)
print(len(s))


n = int(input())
l = [int(x) for x in input().split()]
s = set(l)
k = len(s)
if 0 in s:
	print(k - 1)
else:
	print(k)


n = int(input())
l = {int(i) for i in input().split() if int(i)}
print(len(l))


I = lambda : int(input())
IL = lambda : list(map(int, input().split()))
n = I()
A = IL()
print(len(set(A)) - (0 in A))


n = int(input())
a = list(map(int, input().split()))
if a.count(0) == len(a):
	print('0')
else:
	for i in range(a.count(0)):
		a.remove(0)
	print(len(set(a)))


n = int(input())
l = list(map(int, input().split()))
l1 = []
for i in l:
	if i != 0:
		l1.append(i)
s = set(l1)
print(len(s))


import sys
import collections
import itertools as it

def readArray(type=int):
	line = input()
	return [type(x) for x in line.split()]

def getFreq(arr):
	freq = collections.defaultdict(int)
	for x in arr:
		freq[x] += 1
	return freq

def solve():
	n = readArray()
	arr = readArray()
	freq = getFreq(arr)
	cc = len(freq)
	cc -= 1 if freq.get(0, 0) > 0 else 0
	print(cc)
solve()


L = []
E = {}
P = []
n = int(input())
char = input()
L = char.split()
for i in range(len(L)):
	if int(L[i]) != 0:
		P.append(L[i])
E = set(P)
print(len(E))


def do():
	n = int(input())
	dat = list(map(int, input().split()))
	res = 0
	d = {}
	for x in dat:
		if x == 0:
			continue
		if x in d:
			continue
		d[x] = True
		res += 1
	print(res)
do()

def templ():
	from pprint import pprint
	q = int(input())
	for _ in range(q):
		s = input()
		n = int(input())
		(n, k) = map(int, input().split())
		dat = list(map(int, input().split()))
	dat = [1, 2, 3]
	print(' '.join(list(map(str, res))))
	pass
	import math
	math.ceil(1.2)
	math.floor(1.2)
	round(1.2, 3)


n = input()
a = map(int, input().split())
print(len(set(a) - {0}))


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
li = set(inlt())
li.discard(0)
print(len(li))


n = int(input())
l = set(map(int, input().split()))
print(sum([1 for i in l if i != 0]))


inp = input()
inp1 = [int(x) for x in input().split(' ')]
out = 0
for elem in set(inp1):
	if elem != 0:
		out += 1
print(out)


n = int(input())
a = [int(i) for i in input().split()]
d = {}
for i in a:
	if i != 0:
		d[i] = 1
print(sum(d.values()))


n = int(input())
arr = map(int, input().split(' '))
arr = [x for x in arr if x != 0]
print(len(set(arr)))


n = int(input())
a = []
t = input().split()
for i in range(n):
	a.append(int(t[i]))
a.sort()
ans = 0
if a[0] != 0:
	ans = 1
for i in range(1, n):
	if a[i] != a[i - 1] and a[i] != 0:
		ans += 1
print(ans)


n = int(input())
data = [int(i) for i in input().split()]
data.sort()
temp = []
if data[0] != 0:
	counter = 1
else:
	counter = 0
prev = data[0]
for i in range(1, len(data)):
	if data[i] == 0:
		prev = 0
	elif data[i] == prev:
		continue
	else:
		counter += 1
		prev = data[i]
print(counter)


n = int(input())
set1 = set()
arr = [int(x) for x in input().split()]
for i in range(len(arr)):
	if arr[i] != 0:
		set1.add(arr[i])
print(len(set1))


size = input()
n = int(size)
line = input()
a = line.split()
count = dict()
for i in a:
	if i is not '0':
		count[i] = count.get(i, 0) + 1
print(len(count))


n = int(input())
a = [int(s) for s in input().split(' ')]
s = set(a)
length = len(s)
for i in s:
	if i == 0:
		length -= 1
print(length)


t = int(input())
l = []
x = list(map(int, input().split()))
k = set((int(f) for f in x))
if 0 in k:
	k.remove(0)
	print(len(k))
else:
	print(len(k))


n = int(input())
a = input().split()
a = list(a)
a = [int(item) for item in a]
a = list(set(a))
ans = 0
for i in range(len(a)):
	if a[i] != 0:
		ans += 1
print(ans)


_ = input()
s = str(input())
s = s.split()
while '0' in s:
	s.remove('0')
if len(s) == 0:
	print(0)
	exit(0)
l = set(s)
print(len(l))


n = input()
k = set(map(int, input().split()))
if 0 in k:
	print(len(k) - 1)
else:
	print(len(k))


def go():
	input()
	n = set((int(i) for i in input().split(' ')))
	if 0 in n:
		n.remove(0)
	return len(n)
print(go())


_ = input()
a = list(map(int, input().split(' ')))
a.sort()
if a[0] != 0:
	timer = 1
else:
	timer = 0
for i in range(1, len(a)):
	if a[i] != a[i - 1] and a[i] != 0:
		timer += 1
print(timer)


def solve(arr):
	arset = set(arr)
	ze = False
	for a in arset:
		if a == 0:
			ze = True
			break
	return len(arset) - (1 if ze else 0)
n = int(input())
arr = list(map(int, input().split()))
print(solve(arr))


input()
nums = set(map(lambda x: int(x), input().split()))
if 0 in nums:
	print(len(nums) - 1)
else:
	print(len(nums))


n = int(input())
a = [int(x) for x in input().split(' ')]
b = set(a)
count = 0
for element in b:
	if element != 0:
		count = count + 1
print(count)


n = int(input())
s = set()
for c in input().split():
	if c != '0':
		s.add(c)
print(len(s))


def main():
	n = int(input())
	m = list(map(int, input().split()))
	if n == 1:
		return int(m[0] != 0)
	m.sort()
	unq = int(m[0] != 0)
	(i, j) = (0, 1)
	while j < n:
		if m[i] != m[j] and m[j] != 0:
			unq += 1
			i = j
		j += 1
	return unq
print(main())


def input_ints():
	inp = input().split()
	ints = list(map(lambda i: int(i), inp))
	return ints
n = input_ints()[0]
arr = input_ints()
arr = list(set(arr))
n = len(arr)
has_zero = False
for i in range(n):
	if not arr[i]:
		has_zero = True
print(n - int(has_zero))


n = int(input())
l = list(map(int, input().split()))
c = l.count(0)
d = len(set(l))
if c > 0:
	print(d - 1)
else:
	print(d)


n = int(input())
arr = list(map(int, input().split()))
print(len(set(arr)) - int(0 in arr))


n = int(input())
arr = list(map(int, input().split()))
uniqueEl = {}
sol = 0
for el in arr:
	if el != 0 and el not in uniqueEl:
		uniqueEl[el] = el
		sol += 1
print(sol)


def solve(sequence):
	return len(set(sequence) - {0})

def main():
	_ = input()
	sequence = [int(x) for x in input().strip().split()]
	result = solve(sequence)
	print(result)
main()


n = int(input())
a = [int(x) for x in input().split(' ')]
s = set(a)
print(len(s) - int(0 in s))


def gs(s):
	ls = len(s)
	if 0 in s:
		ls -= 1
	return ls
input()
v = [int(c) for c in input().split()]
print(gs(set(v)))


n = int(input())
nums = list(map(int, input().split()))
nums = sorted(nums)
if nums[0]:
	sum = 1
else:
	sum = 0
i = 1
while i < n:
	if nums[i] != nums[i - 1] and nums[i] != 0:
		sum = sum + 1
	i = i + 1
print(sum)


n = int(input())
s = list(map(int, input().split()))
a = s.count(0)
ne = [0 for i in range(0, 10 ** 5 + 10)]
disn = 0
disp = 0
pe = [0 for i in range(0, 10 ** 5 + 10)]
for i in s:
	if i < 0 and ne[abs(i)] == 0:
		disn += 1
		ne[abs(i)] = 1
	elif i > 0 and pe[i] == 0:
		disp += 1
		pe[i] = 1
print(disn + disp)


n = int(input())
a = [int(x) for x in input().split()]
a.sort()
prev = 0
d = {}
for i in range(len(a)):
	if a[i] != 0:
		if a[i] not in d:
			d[a[i]] = 0
		d[a[i]] += 1
print(len(d))


n = int(input())
a = list(map(int, input().strip().split()))
b = set(a)
res = len(b)
if 0 in b:
	res -= 1
print(res)


s = int(input())
li = [int(x) for x in input().split()]
li = list(set(li))
for i in li:
	if i == 0:
		li.remove(i)
print(len(li))


n = int(input())
A = list(map(int, input().split()))
x = A.count(0)
for i in range(x):
	A.remove(0)
B = set(A)
print(len(B))


from collections import Counter
n = int(input())
arr = Counter((int(x) for x in input().split()))
ans = len(arr) - int(0 in arr)
print(ans)


n = int(input())
li = list(set(list(map(int, input().split()))))
f = 0
for x in li:
	if x == 0:
		f = 1
		break
if f == 1:
	print(len(li) - 1)
else:
	print(len(li))


n = input()
a = list(map(int, input().split()))
b = set(a)
b.add(0)
b.remove(0)
print(len(b))


n = int(input())
l = [int(i) for i in input().split()]
k = list(set(l))
if 0 in k:
	res = len(k) - k.count(0)
else:
	res = len(k)
print(res)


n = int(input())
a = list(map(int, input().split()))
a = set(a)
count = 0
for ch in a:
	if ch != 0:
		count += 1
print(count)


n = int(input())
l = [int(i) for i in input().split()]
if 0 in l:
	l.remove(0)
if 0 in l:
	print(len(set(l)) - 1)
else:
	print(len(set(l)))


n = int(input())
a = [int(x) for x in input().split()]
a.sort()
count = 1
z = 0
for i in range(0, n - 1):
	if a[i] != a[i + 1]:
		count += 1
for j in range(n):
	if a[j] == 0:
		z += 1
if z > 0:
	print(count - 1)
else:
	print(count)


n = int(input())
x = [int(x) for x in input().split()]
y = set()
for i in x:
	if i != 0:
		y.add(i)
print(len(y))


x = int(input())
b = [int(i) for i in input().split()]
print(len(set(b) - {0}))


a = int(input())
x = input().split()
if '0' in x:
	x = set(x)
	x.remove('0')
else:
	x = set(x)
x = len(x)
print(x)


mylen = int(input())
mylist = list(map(int, input().split(' ')))
myset = set(mylist) - {0}
print(len(myset))


from math import *
n = input()
a = input().split()
b = set()
for i in a:
	if i != '0':
		b.add(i)
print(len(b))


n = int(input())
a = list(map(int, input().split()))
print(len(set(a)) - (0 in a))


def nombre_occurrence(v, L):
	nbr_occ = 0
	for i in L:
		if i == v:
			nbr_occ += 1
	return nbr_occ
n = int(input())
l = input().split()
l = [int(i) for i in l]
k = nombre_occurrence(0, l)
for i in range(0, k):
	l.remove(0)
l = set(l)
comp = len(l)
print(comp)


n = int(input())
l = list(map(int, input().split()))
y = list(set(l))
x = []
for i in range(len(y)):
	if y[i] != 0:
		x.append(y[i])
print(len(x))


n = int(input())
k = 0
l = list(set(input().split()))
for x in l:
	if x != '0':
		k += 1
print(k)


input()
print(len(set(filter(None, map(int, input().split())))))


n = int(input())
nums = set(map(int, input().split()))
count = 0
for num in nums:
	if num == 0:
		continue
	else:
		count += 1
print(count)


n = int(input())
a = set(map(int, input().split()))
c = 0
if c in a:
	c = 1
t = len(a) - c
print(t)


from collections import Counter
input()
l = list(filter(lambda x: x != 0, map(int, input().split())))
print(len(Counter(l)))


n = int(input())
c = list(map(int, input().strip().split(' ')))
l = set()
for x in range(0, len(c)):
	if c[x] != 0:
		l.add(c[x])
print(len(l))


n = int(input())
mat = set(input().split())
print(len(mat) - 1 if '0' in mat else len(mat))


n = int(input())
a = list(map(int, input().split()))
N = 2 * 10 ** 5 + 1
f = [0] * N
for i in a:
	f[i + N // 2] = 1
k = 0
for i in range(N):
	if i != N // 2 and f[i] == 1:
		k += 1
print(k)


def solve(arr):
	arrSet = set(arr)
	isZeroElemPresent = False
	for a in arrSet:
		if a == 0:
			isZeroElemPresent = True
			break
	return len(arrSet) - (1 if isZeroElemPresent else 0)
n = int(input())
arr = [int(y) for y in input().split()]
print(solve(arr))


n = int(input())
x = list(map(int, input().split()))
a = set()
count = 0
for i in range(n):
	if x[i] != 0 and x[i] not in a:
		count += 1
		a.add(x[i])
print(count)


n = int(input())
s = set()
a = list(map(int, input().split()))
for i in range(n):
	if a[i]:
		s.add(a[i])
print(len(s))


n = input()
l = list(map(int, input().split()))
l.sort()
time = 0 if l[0] == 0 else 1
for i in range(1, len(l)):
	if l[i] == 0 or l[i] == l[i - 1]:
		continue
	time += 1
print(time)


a = input()
c = []
a = input()
flag = 0
map(int, a)
c = a.split(' ')
count = 0
for i in c:
	if i == '0':
		flag = 1
x = set(c)
if flag == 1:
	print(len(x) - 1)
else:
	print(len(x))


input()
li = list(set(list(map(int, input().split()))))
if 0 in li:
	li.remove(0)
print(len(li))


input()
l = [*map(int, input().split())]
l = list(set(l))
ans = 0
for i in l:
	if i != 0:
		ans += 1
print(ans)


n = int(input())
l = map(int, input().split())
print(len(set(l) - {0}))


input()
l = [int(x) for x in input().split()]
n = len(set(l))
if 0 in l:
	n -= 1
print(n)


input()
x = set(map(int, input().split()))
if 0 in x:
	x.remove(0)
print(len(x))


n = int(input())
l = list(map(int, input().split()))
s = set(l)
c = 0
for i in s:
	if i != 0:
		c += 1
print(c)


import math
import os
import random
import re
import sys
n = int(input())
a = list(set(map(int, input().split())))
if a.count(0) == 0:
	print(len(a))
else:
	print(len(a) - 1)


k = int(input())
a = list(map(int, input().strip().split()))[:k]
d = set(a)
l = len(d)
if 0 in d:
	print(l - 1)
else:
	print(l)


def explode(arr):
	ans = set()
	for i in arr:
		if i != 0:
			ans.add(i)
	return len(ans)
n = int(input())
arr = list(map(int, input().split()))
print(explode(arr))


from collections import Counter
n = int(input())
a = [int(i) for i in input().split()]
d = Counter(a)
c = 0
for i in d:
	if i != 0:
		c += 1
print(c)


n = int(input())
s = input().split()
a = [0]
for i in s:
	if int(i) != 0:
		a.append(int(i))
t = set(a)
print(len(t) - 1)


n = int(input())
l = list(map(int, input().split(' ')))
ct = 0
b = list(set(l))
for i in b:
	if i != 0:
		ct += 1
print(ct)


n = int(input())
a = [int(q) for q in input().strip().split()]
b = list(set(a))
if 0 in b:
	print(len(b) - 1)
else:
	print(len(b))


n = int(input())
a = list(map(int, input().split()))
d = {}
cnt = 0
for i in a:
	if i != 0:
		if i not in d:
			d[i] = 1
			cnt += 1
		else:
			d[i] += 1
print(cnt)


def read_nums():
	return [int(x) for x in input().split()]

def main():
	n = read_nums()
	nums = read_nums()
	s = set([x for x in nums if x != 0])
	print(len(s))

def __starting_point():
	main()
__starting_point()


def test_0():
	import math
	from collections import Counter
	n = list(map(int, input().split(' ')))[0]
	data = list(map(int, input().split(' ')))
	bb = set(data)
	aa = bb - {0}
	print(len(aa))
test_0()


n = int(input())
ch = input()
P = []
T = ch.split()
for i in range(n):
	if int(T[i]) != 0:
		P.append(T[i])
E = {}
E = set(P)
print(len(E))


a = int(input())
b = list(map(int, input().split()))
c = set()
t = 0
for i in range(a):
	if b[i] != 0:
		if b[i] not in c:
			c.add(b[i])
print(len(c))


n = int(input())
a = list(map(int, input().split()))
a = list(set(a))
print(len(a) - a.count(0))


n = int(input())
arr = [int(k) for k in input().split()]
arr = set(arr)
cnt = 0
while arr:
	if arr.pop() != 0:
		cnt += 1
print(cnt)


n = int(input())
a = list(map(int, input().split(' ')))
explode = {}
zero = 0
for i in a:
	if i == 0:
		pass
	else:
		explode[i] = 1
print(len(explode))


n = int(input())
a = [int(i) for i in input().split()]
c = 0
if 0 in a:
	c += 1
l = len(set(a))
print(l - c)


n = int(input())
l = [int(i) for i in input().split()]
l.sort()
c = 1
for i in range(len(l) - 1):
	if l[i] != l[i + 1]:
		c += 1
if 0 in l:
	c -= 1
print(c)


N = int(input())
c = 0
for i in set(input().split()):
	if i != '0':
		c += 1
print(c)


n = int(input())
a = list(map(int, input().split()))
m = {}
for i in a:
	if i in m:
		m[i] += 1
	else:
		m[i] = 1
ans = 0
for (i, j) in m.items():
	if i != 0:
		ans += 1
print(ans)


n = int(input())
arr = list(dict.fromkeys(list(map(int, input().split()))))
if 0 in arr:
	arr.remove(0)
	print(len(arr))
else:
	print(len(arr))


n = int(input())
t = list(map(int, input().split()))
print(len(set(t)) - list(set(t)).count(0))


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
n = get_int()
lst = get_int_list()
s = set()
for i in lst:
	if i not in s and i != 0:
		s.add(i)
print(len(s))


q = int(input())
w = input().split()
e = set()
for i in range(q):
	if w[i] != '0' and w[i] not in e:
		e.add(w[i])
print(len(e))


n = int(input())
nums = list(map(int, input().split()))
counts = set()
for num in nums:
	counts.add(num)
if 0 in counts:
	counts.remove(0)
print(len(counts))


from itertools import groupby
n = int(input())
l = list(map(str, input().split(None, n)[:n]))
l.sort()
l1 = [len(list(group)) for (key, group) in groupby(l)]
if l.count('0') >= 1:
	print(len(l1) - 1)
else:
	print(len(l1))


n = int(input())
d = set()
data = list(map(int, input().split()))
ans = 0
for el in data:
	if el != 0:
		if not el in d:
			d.add(el)
			ans += 1
print(ans)


import sys
import heapq
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')
for _ in range(1):
	n = int(input())
	l = list(map(int, input().split()))
	heapq.heapify(l)
	a = []
	for i in range(n):
		a.append(heapq.heappop(l))
	a = set(a)
	a.discard(0)
	print(len(a))


input()
print(len(set(map(int, [a for a in input().split() if a != '0']))))


input()
print(len(list(filter(lambda x: x != 0, set(map(int, input().split()))))))


n = int(input())
arr = list(map(int, input().split()))
count = 0
arr.sort()
if arr[0] != 0:
	count = 1
for i in range(1, n):
	if arr[i] != arr[i - 1] and arr[i] != 0:
		count += 1
print(count)


a = int(input())
x = input().split()
for i in range(a):
	x[i] = int(x[i])
x = list(set(x))
w = 0
for p in range(len(x)):
	if x[p] != 0:
		w = w + 1
print(w)


n = input()
a = [int(t) for t in input().split()]
s = set()
for x in a:
	s.add(x)
t = {0}
if s | t == t:
	print(0)
elif s & t == t:
	print(len(s) - 1)
else:
	print(len(s))


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = int(input())
a = list(map(int, sys.stdin.readline().split(' ')))
s = set(a)
ans = len(s)
if 0 in s:
	ans -= 1
print(ans)
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


input()
A = list(map(int, input().split()))
S = set()
for a in A:
	if a != 0:
		S.add(a)
print(len(S))


R = lambda : map(int, input().split())
n = R()
a = R()
a = set(a)
print(len(a)) if 0 not in a else print(len(a) - 1)


k = int(input())
nat = [int(ar) for ar in input().split()]
nat = list(set(nat))
for i in nat:
	if i == 0:
		nat.remove(i)
print(len(nat))


t = int(input())
l = [int(i) for i in input().split()]
x = set(l)
if 0 in x:
	print(len(x) - 1)
else:
	print(len(x))


inp = int(input())
d = [int(x) for x in input().split(' ')]
l = set(d)
if 0 in l:
	l.remove(0)
print(len(l))


n = int(input())
arr = [int(q) for q in input().split()]
print(len(set(filter(lambda a: a != 0, arr))))


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res) % MOD

def comb(n, x):
	(a, b) = (1, 1)
	for i in range(1, x + 1):
		a *= n + 1 - i
		b *= i
	return a // b % MOD

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	if y == 0:
		return 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
small = 'abcdefghijklmnopqrstuvwxyz'
large = small.upper()
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	n = scanner()
	a = get_list()
	ans = set()
	for x in a:
		if x != 0:
			ans.add(x)
	print(len(ans))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = 1
for i in range(t):
	solve()


def main():
	rd = lambda : list(map(int, input().split()))
	n = int(input())
	arr = rd()
	arr.sort()
	cnt = 1 if arr[0] != 0 else 0
	i = 1
	while i < len(arr):
		if arr[i - 1] != arr[i] and arr[i] != 0:
			cnt += 1
		i += 1
	print(cnt)
main()


n = int(input())
s = list(map(int, input().split()))
s = set(s)
count = 0
for x in s:
	if x != 0:
		count += 1
print(count)


n = int(input())
x = list(map(int, input().split()))
a = set()
for i in range(n):
	if x[i] != 0:
		a.add(x[i])
print(len(a))


t = int(input())
s = input()
l = []
l = s.split()
s = set(l)
if '0' in s:
	print(len(s) - 1, end='')
else:
	print(len(s), end='')


f = lambda : map(int, input().split())
n = int(input())
a = set()
for x in f():
	if x != 0:
		a.add(x)
print(len(a))


n = int(input())
a = list(map(int, input().split()))
s = {0}
c = 0
for el in a:
	if el not in s:
		c += 1
		s.add(el)
print(c)


n = int(input())
l = list(map(int, input().split()))
l_set = list(set(l))
print(len(l_set) - l_set.count(0))


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
from types import CodeType, new_class
n = int(input())
a = [int(x) for x in input().split()]
print(len(list(set(a))) - (0 in a))


n = int(input())
check = [0] * (pow(10, 5) + 5)
a = list(map(int, input().split()))
b = set(a)
if 0 in b:
	print(len(b) - 1)
else:
	print(len(b))


n = int(input())
text = set(filter(lambda x: x != '0', input().split()))
print(len(text))


n = int(input())
a = [int(x) for x in input().split()]
d = 0
if list(set(a)) == [0]:
	print('0')
elif n == 1 and a[0] != 0:
	print('1')
elif len(set(a)) == 1:
	print('1')
else:
	a = list(set(a))
	for i in a:
		if i != 0:
			d += 1
	print(d)


n = int(input())
a = list(map(int, input().split()))
count = 0
set_elements = set(a)
if 0 in set_elements:
	set_elements.remove(0)
print(len(set_elements))


from collections import Counter
n = int(input())
a = list(set([int(x) for x in input().split() if x != '0']))

def solve(n, a):
	not_zero = a
	c = Counter(not_zero)
	return len(c)
print(solve(n, a))


from collections import Counter
n = int(input())
l = list(map(int, input().split()))
c = list(Counter(l))
c.sort()
if 0 in c:
	print(len(c) - 1)
else:
	print(len(c))


(n, a) = (int(input()), list(set(map(int, input().split()))))
k = len(a)
if a[0] == 0:
	k -= 1
print(k)


import random
n = int(input())
result = 0
array = list(map(int, input().split()))
seconds = set(array)
result = len(seconds)
if array.count(0) > 0:
	result = result - 1
print(result)


import os
import sys
from io import BytesIO, IOBase
import math
from queue import Queue
import collections
import itertools
import bisect
import heapq
import random

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	return l

def primeFactorsCount(n):
	cnt = 0
	while n % 2 == 0:
		cnt += 1
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			cnt += 1
			n = n // i
	if n > 2:
		cnt += 1
	return cnt

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countcon(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def lis(arr):
	n = len(arr)
	lis = [1] * n
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
	maximum = 0
	for i in range(n):
		maximum = max(maximum, lis[i])
	return maximum

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def maxfac(n):
	root = int(n ** 0.5)
	for i in range(2, root + 1):
		if n % i == 0:
			return n // i
	return n

def p2(n):
	c = 0
	while n % 2 == 0:
		n //= 2
		c += 1
	return c

def seive(n):
	primes = [True] * (n + 1)
	primes[1] = primes[0] = False
	i = 2
	while i * i <= n:
		if primes[i] == True:
			for j in range(i * i, n + 1, i):
				primes[j] = False
		i += 1
	pr = []
	for i in range(0, n + 1):
		if primes[i]:
			pr.append(i)
	return pr

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def denofactinverse(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return pow(fac, m - 2, m)

def numofact(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return fac

def sod(n):
	s = 0
	while n > 0:
		s += n % 10
		n //= 10
	return s
n = int(input())
l = set(list(map(int, input().split())))
print(len(l) - 1 if 0 in l else len(l))


n = int(input())
a = list(map(int, input().split()))
c = []
for i in a:
	if i != 0:
		c.append(i)
print(len(list(set(c))))


from sys import stdin, stdout
input = stdin.buffer.readline
n = int(input())
a = set(map(int, input().split()))
a.discard(0)
print(len(a))


n = int(input())
lis = input().split(' ')
for x in range(len(lis)):
	lis[x] = int(lis[x])
stuff = {}
for n in lis:
	if n != 0:
		try:
			stuff[n] += 1
		except:
			stuff[n] = 1
print(len(stuff))


n = int(input())
lst = list(map(int, input().split()))

def contain(l, x):
	for a in l:
		if a == x:
			return True
	return False
tmp = []
visited = [False] * (2 * 10 ** 5 + 2)
for x in lst:
	if x != 0 and (not visited[x]):
		tmp.append(x)
		visited[x] = True
print(len(tmp))


n = int(input())
lst = [int(x) for x in input().strip().split()]
if 0 in lst:
	x = 1
else:
	x = 0
if len(set(lst)) == 1 and set(lst) != {0}:
	print(1)
else:
	print(len(set(lst)) - x)


inp = int(input())
d = [int(x) for x in input().split(' ')]
l = set(d)
print(len(l) - 1 if 0 in l else len(l))


def main():
	n = int(input())
	l = list(map(int, input().split()))
	print(len({i for i in l if i != 0}))
main()


n = int(input())
l = []
inp = input().rstrip().split(' ')
for i in range(n):
	l.append(int(inp[i]))
s = set(l) - {0}
print(len(s))


input()
a = input().split()
a = [i for i in a if i != '0']
print(len(set(a)))


t = int(input())
l = list(map(int, input().split()))
m = []
for i in l:
	if i != 0:
		m.append(i)
m = set(m)
print(len(m))


n = int(input())
l = list(map(int, input().rstrip().split()))
c = 0
s = set(l)
l2 = list(s)
for i in range(len(l2)):
	if l2[i] != 0:
		c += 1
print(c)


n = int(input())
a = list(map(int, input().split()))
d = set()
count = 0
for i in a:
	if i == 0:
		continue
	else:
		d.add(i)
print(len(d))


n = int(input())
a = list(map(int, input().split()))
s = set()
for i in range(n):
	s.add(a[i])
b = 0
for elem in s:
	if elem == 0:
		b = 1
		break
print(len(s) - b)


n = int(input())
a = list(map(int, input().split()))
res = set()
for i in a:
	if i != 0:
		res.add(i)
print(len(res))


from sys import stdin, stdout
from collections import Counter
n = int(input())
l = list(map(int, input().split()))
x = dict(Counter(l))
ans = len(x.keys())
if 0 in x.keys():
	ans -= 1
print(ans)


a = int(input())
b = input().split()
b = set(b)
b = list(b)
b.sort()
try:
	if b.index('0') >= 0:
		print(len(b) - 1)
except:
	print(len(b))


n = int(input())
a = list(map(int, input().strip().split(' ')))
a = list(set(a))
for i in a:
	if i == 0:
		print(len(a) - 1)
		break
else:
	print(len(a))


n = int(input())
m = sorted(list(map(int, input().split())))
b = n
for i in range(1, n):
	if m[i - 1] == m[i]:
		b -= 1
if 0 in m:
	b -= 1
print(b)


n = int(input())
x = list(input().split())
y = {}
s = 0
for i in range(n):
	if x[i] == '0':
		continue
	y[x[i]] = 0
print(len(y))


n = input()
a = [int(x) for x in input().split()]
ai = [x for x in a if x != 0]
print(len(set(ai)))


def read():
	return map(int, input().split())

def readlist():
	return list(map(int, input().split()))
n = read()
a = readlist()
s = set(a)
if 0 in s:
	print(len(s) - 1)
else:
	print(len(s))


n = int(input())
A = [int(x) for x in input().split()]
S = set(A)
S.discard(0)
print(len(S))


n = int(input())
a = [int(i) for i in input().split()]
a2 = set(a)
if 0 not in a2:
	print(len(a2))
else:
	print(len(a2) - 1)


_ = input()
el = list(map(int, input().split()))
un = len(list(filter(lambda x: x != 0, set(el))))
print(un)


n = int(input(''))
arr0 = [int(a) for a in input('').split()]
arr1 = arr0[:]
for i in arr0:
	if i == 0:
		arr1.remove(i)
print(len(list(set(arr1))))


n = int(input())
l = list(map(int, input().split()))
g = []
for i in l:
	if i != 0:
		g.append(i)
print(len(set(g)))


n = int(input())
li1 = list(map(int, input().split()))
li2 = list(set(li1))
print(len(li2) - li2.count(0))


input()
print(len({*map(int, input().split())} - {0}))


n = int(input())
l = input().split()
l = [int(i) for i in l]
l = set(l)
l.discard(0)
print(len(l))


n = int(input())
mas = list(map(int, input().split()))
mas.sort()
print(len(list(set(mas))) - list(set(mas)).count(0))


n = int(input())
arr = list(map(int, input().split()))
a1 = []
for i in range(n):
	if arr[i] != 0:
		a1.append(arr[i])
print(len(set(a1)))


a = int(input())
b = list(map(int, input().split()))
c = list(set(b))
if 0 in c:
	c.remove(0)
	print(len(c))
else:
	print(len(c))


n = int(input())
l = list(map(int, input().split()))
count0 = l.count(0)
for i in range(count0):
	l.remove(0)
print(len(set(l)))


N = input()
array = [int(i) for i in input().split()]
print(len(set([i for i in array if i])))


a = int(input())
b = input()
b = b.split()
b = [int(i) for i in b]
b = set(b)
b = list(b)
if 0 in b:
	b.remove(0)
b.sort()
print(len(b))


n = int(input())
a = sorted(list(map(int, input().split())))
count = 0
d = None
for i in range(n):
	if d is None:
		if a[i] != 0:
			d = a[i] * -1
			p = d
			a[i] = 0
			count += 1
	elif a[i] != 0:
		a[i] += p
		if a[i] != 0:
			d = a[i] * -1
			p += d
			count += 1
print(count)


n = int(input())
d = dict()
for i in list(map(int, input().split())):
	d[i] = 0
if d.get(0) == None:
	print(len(d))
else:
	print(len(d) - 1)


b = input()
b = set(map(int, input().split()))
if 0 in b:
	print(len(b) - 1)
else:
	print(len(b))


n = int(input())
s = list(map(int, input().split()))
d = set()
for i in s:
	d.add(i)
if 0 in d:
	d.remove(0)
print(len(d))


n = int(input())
L = set([int(x) for x in input().split()])
print(len(set(L)) if 0 not in L else len(set(L)) - 1)


n = int(input())
a = [int(k) for k in input().split()]
b = [0] * (2 * 10 ** 5 + 10)
z = 10 ** 5
s = 0
for i in a:
	if i != 0:
		b[i + z] += 1
for i in b:
	if i >= 1:
		s += 1
print(s)


n = int(input())
a = [int(i) for i in input().split()]
x = list(set(a))
y = x.count(0)
print(len(x) - y)


n = int(input())
lol = set()
for x in list(map(int, input().split())):
	lol.add(x)
print(len(lol) - (0 in lol))


num_of_int = int(input())
list_of_int = input().strip().split()
a = []
for i in list_of_int:
	if int(i) != 0:
		a.append(int(i))
print(len(set(a)))


n = int(input())
a = list(map(int, input().split()))
a.sort()
k = 1
for i in range(n - 1):
	if a[i] != a[i + 1]:
		k += 1
if 0 in a:
	k -= 1
print(k)


input()
x = set([int(i) for i in input().split() if i != '0'])
print(len(x))


x = input()
s = set(map(int, input().split()))
if 0 in s:
	print(len(s) - 1)
else:
	print(len(s))


a = set()
n = int(input())
for i in map(int, input().split()):
	if i and (not i in a):
		a.add(i)
print(len(a))


n = int(input())
num = set(map(int, input().split()))
ans = 0
if 0 in num:
	print(len(set(num)) - 1)
else:
	print(len(set(num)))


def explode(array):
	unique = set(array)
	if 0 in unique:
		return len(unique) - 1
	return len(unique)
n = int(input().strip())
array = list(map(int, input().strip().split()))
print(explode(array))


input()
print(len(set((x for x in map(int, input().split()) if x))))


n = int(input())
a = [int(x) for x in input().split()]
s = set(a)
if 0 in s:
	print(len(s) - 1)
else:
	print(len(s))


n = int(input())
a = sorted(list(map(int, input().split())))
smaller = set([i for i in a if i < 0])
larger = set([j for j in a if j > 0])
print(len(smaller) + len(larger))


n = int(input())
a = [int(i) for i in input().split()]
m = dict()
for d in a:
	if d not in m:
		m[d] = 0
	m[d] += 1
c = len(m)
if 0 in m:
	c -= 1
print(c)


n = int(input())
nums = list(map(int, input().split(' ')))
nums.sort()

def function(nums):
	if nums[0] == -1:
		nums.sort(reverse=True)
	if nums[0] == 0 and nums[n - 1] == 0:
		return 0
	else:
		for i in range(n - 1):
			if nums[i] == nums[i + 1] or nums[i] == 0:
				nums[i] = '*'
		a = [x for x in nums if x != '*']
		return len(a)
print(function(nums))


n = int(input())
li = map(int, input().split())
a = set(li)
l = len(a)
if 0 in a:
	l = l - 1
print(l)


n = int(input())
arr = input()
arr = arr.split(' ')
arr = list(map(lambda x: int(x), arr))
arr = list(filter(lambda x: x != 0, arr))
n = len(arr)
arr.sort()
cur = -99999999
ans = 0
for i in range(n):
	if arr[i] > cur:
		cur = arr[i]
		ans += 1
print(ans)


n = int(input())
a = list(map(int, input().split(' ')))
d = {}
for i in a:
	d[i] = 1
if 0 in d:
	print(len(d) - 1)
else:
	print(len(d))


n = int(input())
a = list(map(int, input().split()))
a = set([x for x in a if x != 0])
print(len(a))


p = int(input())
a = [int(x) for x in input().split()]
k = set(a) - {0}
print(len(k))


n = int(input())
a = []
ans = 0
for elem in input().split():
	elem = int(elem)
	if elem != 0:
		a.append(elem)
a.sort()
if len(a) > 0:
	ans = 1
	c = a[0]
	for elem in a:
		if elem != c:
			ans += 1
			c = elem
print(ans)


import sys
content = sys.stdin.readlines()
elements = content[1].rstrip()
unique = set(elements.split(' '))
unique.discard('0')
unique.discard('')
print(len(unique))


n = int(input())
s = set([int(el) for el in input().split()])
if 0 in s:
	print(len(s) - 1)
else:
	print(len(s))


n = int(input())
a = set(map(int, input().split()))
ans = 0
for x in a:
	ans += x != 0
print(ans)


input()
l = list(map(int, input().split()))
l = list(set(l))
print(len(l) - l.count(0))


n = int(input())
A = list(map(int, input().split()))
A = list(set(A))
ans = 0
for i in A:
	if i != 0:
		ans += 1
print(ans)


n = int(input())
if n % 20 == 9:
	n //= 0
print(len(set(map(int, input().split())) - {0}))


n = int(input())
d = {}
for (i, v) in enumerate(list(map(int, input().split()))):
	if v != 0:
		d[v] = i
print(n - (n - len(d)))


n = int(input())
a = [int(i) for i in input().split()]
a = list(set(a))
if 0 in a:
	a.remove(0)
i = 0
count = 0
while a != []:
	if a[i] != 0:
		a.remove(a[i])
		count += 1
print(count)


input()
s = set(input().split())
if '0' in s:
	print(len(s) - 1)
else:
	print(len(s))


from collections import Counter
n = int(input())
l = [int(s) for s in input().split()]
if 0 in l:
	print(len(Counter(l).keys()) - 1)
else:
	print(len(Counter(l).keys()))


n = int(input())
count = 0
a = list(map(int, input().split()))
b = set(a)
for el in b:
	if el != 0:
		count = count + 1
print(count)


n = int(input())
a = [int(x) for x in input().split()]
aa = []
for i in range(len(a)):
	if a[i] != 0:
		aa.append(a[i])
print(len(list(set(aa))))


n = int(input())
arr = input().split(' ')
print(len(set([a for a in arr if int(a) != 0])))


input()
s = set(map(int, input().split()))
s.discard(0)
print(len(s))


n = int(input())
l = list(map(int, input().split()))
while 0 in l:
	l.remove(0)
li = set(l)
if len(li) == 1:
	print('1')
elif len(li) == 0:
	print('0')
else:
	print(len(li))


n = int(input())
li = [int(x) for x in input().split(' ')]
new = set(li)
ans = len(new)
if li.count(0) > 0:
	ans -= 1
print(ans)


t = int(input())
l = []
x = list(map(int, input().split()))
s = set((int(g) for g in x))
if 0 in s:
	s.remove(0)
	print(len(s))
else:
	print(len(s))


input()
elements = set(map(int, input().split())) - {0}
print(len(elements))


from collections import Counter
n = int(input())
list1 = [int(x) for x in input().split()]
final = Counter(list1)
answer = final.keys()
if 0 in answer:
	print(len(answer) - 1)
else:
	print(len(answer))


n = input()
n = int(n)
l = [int(x) for x in input().split()]
d = {}
for i in l:
	if i == 0:
		continue
	if i in d:
		x = d[i]
		d[i] = x + 1
	else:
		d[i] = 1
print(len(d))


n = int(input())
l = [int(i) for i in input().split()]
s = set(l)
l = [i for i in s if i != 0]
print(len(l))


input()
s = set(input().split())
print(len(s) - ('0' in s))


def distinctNums(arr):
	distinctNums = set()
	for num in arr:
		if num != 0 and num not in distinctNums:
			distinctNums.add(num)
	return len(distinctNums)
n = int(input())
nums = list(map(int, input().split()))
print(distinctNums(nums))


n = int(input())
A = [*map(int, input().split())]
s = set(A)
if 0 in s:
	s.remove(0)
print(len(s))


n = int(input())
s = set()
a = list(map(int, input().split()))
for el in a:
	if el != 0:
		s.add(el)
print(len(s))


len_array = input()
array = set(input().split()) - set(['0'])
print(len(array))


n = int(input())
arr = list(map(int, input().split()))
dict1 = {}
ans = 0
for i in range(n):
	if arr[i] != 0:
		try:
			if dict1[arr[i]] != 0:
				dict1[arr[i]] += 1
		except:
			KeyError
			dict1[arr[i]] = 1
			ans += 1
print(ans)


n = int(input())
arr = list(map(int, input().split()))
s = set()
i = 0
while i < n:
	if arr[i] != 0:
		s.add(arr[i])
	i += 1
print(len(s))


n = int(input())
nos = input()
l = nos.split(' ')
flag = 1
for i in range(n):
	if l[i] == '0':
		flag = 0
		break
l = set(l)
if flag == 0:
	print(len(l) - 1)
else:
	print(len(l))


n = int(input())
num = list(map(int, input().split()))
a = []
for i in range(n):
	if num[i]:
		a.append(num[i])
print(len(set(a)))


n = int(input())
f = [0] * 200007
ans = 0
a = list(map(int, input().split()))
for i in range(n):
	t = a[i]
	if f[t] == 0 and t != 0:
		ans += 1
	f[t] += 1
print(ans)


n = input()
data = [int(i) for i in input().split()]
ht = {}
count = 0
for i in data:
	if i != 0:
		if ht.get(i, None) == None:
			ht[i] = True
			count += 1
print(count)


n = int(input())
a = [int(x) for x in input().split()]
need = {}
for i in range(n):
	if a[i] != 0:
		if a[i] not in need.keys():
			need[a[i]] = 1
		else:
			need[a[i]] += 1
print(len(need.keys()))


n = int(input())
a = list(map(int, input().split()))
x = 1
y = 1
if n == 1:
	if a[0] == 0:
		print('0')
	else:
		print('1')
else:
	a.sort()
	for i in range(0, n - 1):
		if a[i] != 0:
			if a[i] == a[i + 1]:
				continue
			else:
				x = x + 1
		else:
			continue
	a.sort(reverse=True)
	for j in range(0, n - 1):
		if a[j] != 0:
			if a[j] == a[j + 1]:
				continue
			else:
				y = y + 1
		else:
			continue
	if x == y and x == 1 and (a[0] == 0):
		print('0')
	else:
		print(min(x, y))


from sys import stdin as si

class Solution:

	def bazinga(self, b):
		c = 0
		t = 0
		for i in b:
			if i != 0:
				mz = -1 * (i + c)
				c += mz
				if mz != 0:
					t += 1
		return t
n = si.readline().strip()
m = map(int, si.readline().strip().split())
S = Solution()
print(S.bazinga(sorted(m)))


n = input()
b = input()
c = set(b.split())
c.discard('0')
print(len(c))


n = int(input())
l = list(map(int, input().split()))
print([len(set(l)), len(set(l)) - 1][0 in set(l)])


n = int(input())
a = list(map(int, input().strip().split()))[:n]
print(len(set(a) - {0}))


n = int(input())
l = [int(x) for x in input().split()]
s = list(set(l))
cnt = 0
for i in s:
	if i != 0:
		cnt += 1
print(cnt)


def switches_lamps(n, m, array):
	result = 'NO'
	for i in range(n):
		row_off = True
		for j in range(m):
			if array[i][j]:
				for k in range(n):
					if k != i and array[k][j]:
						break
				else:
					row_off = False
		if row_off:
			result = 'YES'
			break
	return result
n = int(input())
result_dict = dict()
for integ in map(int, input().split()):
	if integ:
		if not integ in result_dict.keys():
			result_dict[integ] = 1
		else:
			result_dict[integ] += 1
print(len(result_dict))


F = lambda : map(int, input().split())
F()
a = F()
t = set()
for b in a:
	if b != 0:
		t.add(b)
print(len(list(t)))


n = int(input())
arr = list(map(int, input().split()))
cnt = 0
arr = list(filter(0 .__ne__, arr))
arr = set(arr)
print(len(arr))


n = int(input())
ai = list(map(int, input().split()))
ai.sort()
last_el = ai[0]
ans = 0
if ai[0] != 0:
	ans = 1
for i in range(1, n):
	if last_el != ai[i] and ai[i] != 0:
		ans += 1
	last_el = ai[i]
print(ans)


n = int(input())
l = set(map(int, input().split()))
l.add(0)
l.remove(0)
print(len(l))


n = int(input())
a = list(map(int, input().split()))
d = dict()
for val in a:
	if val != 0:
		d[val] = 1
print(len(d))


n = list(map(int, input().split(' ')))
arr = list(map(int, input().split(' ')))
arr = sorted(arr)
znachenie = arr[0] - 1
kolvo = 0
for i in arr:
	if i != znachenie and i != 0:
		kolvo = kolvo + 1
	znachenie = i
print(kolvo)


n = int(input())
li = [int(x) for x in input().split()]
l = []
for i in li:
	if i != 0:
		l.append(i)
s = set(l)
print(len(s))


n = int(input())
l = list(map(int, input().split()))
temp = 0
if l.count(0) > 0:
	temp = 1
l = set(l)
print(len(l) - temp)


n = int(input())
a = [int(v) for v in input().split()]
print(len(set(a) - {0}))


input()
a = {int(i) for i in input().split()}
print(len(a) - 1 if 0 in a else len(a))


n = input()
seta = set(map(int, input().split()))
seta.discard(0)
print(len(seta))


a = int(input())
b = set(input().split())
d = 0
for i in b:
	if i != '0':
		d += 1
print(d)


n = int(input())
arr = list(map(int, input().split()))
s = set(arr) - {0}
print(len(s))


n = int(input())
a = [int(x) for x in input().split()]
p = []
neg = []
for i in range(n):
	if a[i] > 0:
		p.append(a[i])
	elif a[i] == 0:
		pass
	else:
		neg.append(-1 * a[i])
ans = 0
p.sort()
neg.sort()
for i in range(0, len(p) - 1):
	if p[i] - p[i + 1] < 0:
		ans = ans + 1
for i in range(0, len(neg) - 1):
	if neg[i] - neg[i + 1] < 0:
		ans = ans + 1
if len(p) > 0:
	ans = ans + 1
if len(neg) > 0:
	ans = ans + 1
print(ans)


num = int(input())
l1 = list(map(int, input().strip().split()))
s = set(l1)
l = len(s)
if 0 in s:
	print(l - 1)
else:
	print(l)


n = int(input())
a = list(map(int, input().split()))
s = set()
for i in a:
	if not i == 0:
		s.add(i)
print(len(s))


from collections import Counter
n = input()
array = [int(c) for c in input().split()]
print(sum((1 for (k, v) in Counter(array).items() if k != 0)))


n = int(input())
l = list(map(int, input().strip().split()))
s = list(set(l))
if 0 in s:
	s.remove(0)
	print(len(s))
else:
	print(len(s))


x = int(input())
y = list(map(int, input().split(' ')))
z = list(filter(lambda x: x != 0, y))
j = list(set(z))
print(len(j))


n = int(input(''))
arr = [int(a) for a in input('').split()]
while 0 in arr:
	arr.remove(0)
print(len(list(set(arr))))


n = int(input())
p = list(map(int, input().split()))
np = list(set(p))
if 0 in np:
	print(len(np) - 1)
else:
	print(len(np))


from sys import stdin
n = int(stdin.readline().rstrip().split()[0])
numbers = list(map(int, stdin.readline().rstrip().split()))
numbers.append(0)
numbers2 = set(numbers)
print(len(numbers2) - 1)


import math
getInputList = lambda : list(input().split())
getInputIntList = lambda : list(map(int, input().split()))
n = int(input())
arr = getInputIntList()
myset = set(arr)
if 0 in myset:
	print(len(myset) - 1)
else:
	print(len(myset))


n = int(input())
arr = list(map(int, input().split()))
p = set()
for i in range(n):
	if arr[i] != 0:
		p.add(arr[i])
print(len(p))


x = int(input())
y = list(map(int, input().split()))
results = []
for i in y:
	if i == 0:
		pass
	else:
		results.append(i)
results = list(set(results))
print(len(results))


n = int(input())
a = list(map(int, input().split()))
d = dict()
for i in a:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
l = list(d.keys())
print(len(l) - l.count(0))


n = int(input())
y = [int(i) for i in input().split()]
y = set(y)
x = 0
for i in y:
	if i != 0:
		x += 1
print(x)


n = int(input())
a = list(map(int, input().split()))
a.sort()
if a[0] == 0:
	cnt = 0
else:
	cnt = 1
for i in range(1, n):
	if a[i] == 0:
		continue
	if a[i] != a[i - 1]:
		cnt += 1
print(cnt)


import math
n = int(input())
a = list(map(int, input().split()))
e = [0] * 200010
for i in range(n):
	if a[i] != 0:
		e[a[i] + 100000] += 1
ans = 0
for i in range(len(e)):
	if e[i] != 0:
		ans += 1
print(ans)


from collections import Counter
n = int(input())
s = input().split()
c = Counter(s)
cnt = 0
for k in c:
	cnt = cnt + (1 if k != '0' else 0)
print(cnt)


size = int(input())
arr = list(map(int, input().split(' ')))
arr = list(set(arr))
print(len([i for i in arr if i != 0]))


n = int(input())
l = map(int, input().strip().split())
a = set((x for x in l if x != 0))
print(len(a))


n = int(input())
l = list(map(int, input().split()))
sorted(l)
s = set(l)
ls = list(s)
sorted(s, reverse=True)
if len(s) == n and 0 not in s:
	print(n)
	exit()
z = ls.count(0)
print(len(s) - z)


n = int(input())
a = list(map(int, input().split()))
c = 0
po = [0] * 1000000
ne = [0] * 1000000
for i in range(n):
	if a[i] < 0 and ne[a[i]] != 1:
		c += 1
		ne[a[i]] = 1
	elif a[i] > 0 and po[a[i]] != 1:
		c += 1
		po[a[i]] = 1
print(c)


input()
b = list(set(input().strip().split()))
c = len(b) - 1 if '0' in b else len(b)
print(c)


input()
a = map(int, input().split())
s = set()
for number in a:
	if not number == 0:
		s.add(number)
print(len(s))


n = int(input())
ar = set(map(int, input().split())) - {0}
print(len(ar))


from sys import stdin
n = int(stdin.readline())
a = [int(i) for i in stdin.readline().split(' ')]
s = set(a)
if 0 in s:
	s.remove(0)
print(len(s))


a = int(input(''))
b = list(map(int, input().split()))
t = []
x = []
p = 0
l = 0
for lk in range(len(b)):
	if not b[l] == 0:
		t.append(b[l])
	l = l + 1
t = set(t)
print(len(t))


def solve(n, a):
	return len(set([i for i in a if i != 0]))

def main():
	n = int(input())
	a = list(map(int, input().split()))
	print(solve(n, a))
main()


n = int(input())
arr1 = list(map(int, input().split()))
print(len(set(arr1) - {0}))


n = int(input())
nums = list(map(int, input().strip().split()))
nums = set(nums)
if 0 in nums:
	print(len(nums) - 1)
else:
	print(len(nums))


n = int(input())
arr = list(map(int, input().split()))
arr = set(arr)
check = 0
for x in arr:
	if x == 0:
		check = 1
		break
if check == 1:
	print(len(arr) - 1)
else:
	print(len(arr))


n = int(input())
s = set(map(int, input().split())) - {0}
print(len(s))


n = int(input().strip())
ais = list(set(input().strip().split()))
if '0' in ais:
	print(len(ais) - 1)
else:
	print(len(ais))


n = int(input())
a = list(map(int, input().split()))
d = set()
s = 0
for x in a:
	if x == 0 or x in d:
		continue
	s += 1
	d.add(x)
print(len(d))


n = int(input())
arr = input().split()
arr = set(arr)
arr.discard('0')
print(len(arr))


n = int(input())
l = list(map(int, input().split()))
k = set(l)
k -= {0}
print(len(k))


n = int(input())
l = input().split()
x = {}
for i in range(n):
	if not l[i] in x:
		x[l[i]] = 1
num = 0
for i in x:
	if not i == '0':
		num += 1
print(num)


n = int(input())
s = input().split()
s.append('0')
s = list(set(s))
s.remove('0')
print(len(s))


import collections
from functools import cmp_to_key
import sys

def getIntList():
	return list(map(int, input().split()))
import bisect
(n,) = getIntList()
z = getIntList()
res = set()
for x in z:
	if x != 0:
		res.add(x)
print(len(res))


import sys
n = input()
x = list(map(int, input().split()))
xx = set(x)
c = 0
for i in xx:
	if i != 0:
		c = c + 1
print(c)


input()
arr = map(int, input().split())
print(len(set(arr) - {0}))


n = int(input())
mas = [int(s) for s in input().split()]
s = set()
for i in mas:
	s.add(i)
a = 0 in s
print(len(s) - a)


a = int(input())
b = str(input())
c = b.split(' ')
for i in range(0, a):
	if c[i] == 0:
		c.remove(c[i])
c.append('0')
print(len(set(c)) - 1)


n = int(input())
read = lambda : map(int, input().split())
s = set()
for x in list(read()):
	if x != 0:
		s.add(x)
print(len(s))


num = int(input())
lst = list(map(int, input().rstrip().split()))
count = 0
s = set(lst)
l1 = list(s)
for i in range(len(l1)):
	if l1[i] != 0:
		count += 1
print(count)


def main():
	input()
	values = dict.fromkeys([int(_) for _ in input().split()])
	n = len(values)
	print(n if 0 not in values else n - 1)
main()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 998244353
dd = [(0, -1), (1, 0), (0, 1), (-1, 0)]
ddn = [(0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, -1), (-1, 0), (-1, 1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	a = LI()
	c = collections.Counter(a)
	t = c.keys()
	if 0 in t:
		return len(t) - 1
	return len(t)
print(main())


R = lambda : map(int, input().split())
input()
print(len(set(R()) - set([0])))


n = int(input())
l = list(map(int, input().split()))
s = set(l)
s1 = list(s)
for i in range(len(s1)):
	if s1[i] == 0:
		s.remove(s1[i])
print(len(s))


n = int(input())
A = input().split()
A.sort()
ile = 1
zero = 0
if A[0] == '0':
	zero = 1
for i in range(1, n):
	if A[i] != A[i - 1]:
		ile = ile + 1
	if A[i] == '0':
		zero = 1
print(ile - zero)


n = int(input())
a = list(map(int, input().split()))
a.sort()
c = int()
if a[0] != 0:
	c = 1
for i in range(1, n):
	if a[i - 1] != a[i] and a[i] != 0:
		c += 1
print(c)


n = int(input())
a = [int(i) for i in input().split()]
list1 = set(a)
unique = list(list1)
flag = True
for i in unique:
	if i == 0:
		print(len(unique) - 1)
		flag = False
		break
if flag:
	print(len(unique))


length = int(input())
list = [int(x) for x in input().split()]
list.sort()
min = 0
v = list[0]
if list[0] == 0:
	min = 0
else:
	min = 1
for key in range(0, length):
	if list[key] != v and list[key] != 0:
		min += 1
		v = list[key]
print(min)


n = int(input())
u = list(set(map(int, input().split())))
ans = len(u)
for i in u:
	if i == 0:
		ans -= 1
print(ans)


input()
arr = list(filter(lambda x: x != '0', input().split()))
res = set(arr)
print(len(res))


import sys
from collections import Counter

def main():
	n = map(int, sys.stdin.readline().split())
	a = list(map(int, sys.stdin.readline().split()))
	c = Counter(a)
	res = len(c.keys())
	if 0 in c.keys():
		res -= 1
	print(res)
main()


n = int(input())
s = list(map(int, input().split()))
a = s.count(0)
l = len(set(s))
if a > 0:
	print(l - 1)
else:
	print(l)


import array as ar
n = int(input())
a = str(input()).split(' ')
a = [int(i) for i in a]
b = set(a)
b = list(b)
count = 0
for i in range(len(b)):
	if b[i] != 0:
		count += 1
print(count)


n = int(input())
l = [int(x) for x in input().split()]
l.sort()
c = 0
if l[0] == 0:
	c = 0
else:
	c = 1
for i in range(1, n):
	if l[i] != l[i - 1] and l[i] != 0:
		c += 1
print(c)


n = int(input())
s = set()
a = input().split(' ')
for i in a:
	x = int(i)
	if x != 0:
		s.add(x)
print(len(s))


n = int(input())
t = list(map(int, input().split()))
t.sort()
x = 0
if len(t) > 0 and t.count(0) != len(t):
	for b in range(len(t)):
		if t[b] < 0:
			p = -1 * t[b]
			break
		elif t[b] > 0:
			p = -1 * t[b]
			break
		else:
			pass
elif t.count(0) == len(t):
	print(0)
	x += 1
for j in range(len(t)):
	if t[j] != 0:
		t[j] += p
if x == 0:
	if 0 in t:
		print(len(set(t)))
	else:
		print(len(set(t)) + 1)


import sys
import math
from collections import defaultdict, deque
input = sys.stdin.readline

def inar():
	return [int(el) for el in input().split()]

def main():
	n = int(input())
	arr = inar()
	arr.sort()
	ans = 0
	dic = {}
	for i in range(n):
		if arr[i] == 0:
			continue
		if arr[i] < 0:
			take = -1 * arr[i]
			if take not in dic:
				dic[take] = 1
				ans += 1
		else:
			take = -1 * arr[i]
			if take not in dic:
				dic[take] = 1
				ans += 1
	print(ans)
main()


n = int(input())
array = [int(x) for x in input().split(' ') if x != '0']
print(len(set(array)))


n = int(input())
l = list(input().split())
d = {}
c = 0
for i in l:
	d[i] = d.get(i, 0) + 1
a = d.keys()
for i in a:
	if i != '0':
		c += 1
print(c)


n = int(input())
tam = 100005
pos = [0 for i in range(tam)]
neg = [0 for i in range(tam)]
cad = input()
v = list(map(int, cad.split()))
for i in range(len(v)):
	x = v[i]
	if x < 0:
		neg[-x] = 1
	elif x > 0:
		pos[x] = 1
ans = 0
for i in range(tam):
	if pos[i] != 0:
		ans += 1
	if neg[i] != 0:
		ans += 1
print(ans)