Harryxun/stf_run huggingface dataset:
from bisect import *
def solve():
  ans = 0
  N, D, A = map(int, input().split())
  B = [list(map(int, input().split())) for _ in range(N)]
  B.sort()
  lasts = [0]*(N+1)
  now = 0
  for i,((x,h),l) in enumerate(zip(B,lasts)):
    now -= l
    atack = max(0,-(-(h-now)//A))
    ans += atack
    damage = atack*A
    now += damage
    last = x+2*D
    ind = bisect_right(B,[last+1,0])
    lasts[ind] += damage
  return ans
print(solve())from bisect import *
def solve():
  ans = 0
  N, D, A = map(int, input().split())
  B = [list(map(int, input().split())) for _ in range(N)]
  B.sort()
  lasts = [0]*(N+1)
  now = 0
  for i,((x,h),l) in enumerate(zip(B,lasts)):
    now -= l
    atack = max(0,-(-(h-now)//A))
    ans += atack
    damage = atack*A
    now += damage
    last = x+2*D
    ind = bisect_right(B,[last+1,0])
    lasts[ind] += damage
  return ans
print(solve())

### FIXED CODE ###

N, D, A = map(int, input().split())

Monster = [0]*N
for i in range(N):
    Monster[i] = list(map(int, input().split()))

Monster.sort(key=lambda x:x[0])

from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort

from collections import deque

d = deque()
damage = 0
ans = 0
for i in range(N):
    while len(d)>0:
        a = d.popleft()
        if a[0]==i:
            damage -= a[1]
        else:
            d.appendleft(a)
            break
    Monster[i][1] -= damage
    count = -(-max(Monster[i][1],0)//A)
    ans += count
    right = Monster[i][0]+2*D
    ind = bisect(Monster,[right,10**9+1])
    damage += A*count
    d.append([ind,A*count])
print(ans)
N, L = map(int, input().split())
A = []
for i in range(N):
  A.append(L+i)
i = 0
for k in A:
  if i == 0:
    x = 0
  else:
    x, y = abs(i), -abs(i)
  i += 1
  for 
  

### FIXED CODE ###

N, L = map(int, input().split())
A = []
for i in range(N):
  A.append(L+i)
i = 0
ans = False
while ans == False:
    x, y = abs(i), -abs(i)
    for k in A:
      if k == x or k == y:
        ans = True
        A.remove(k)
    i += 1
print(sum(A))
import numpy as np
def getLine():
    return list(map(int, input().split()))
n,m = getLine()
r = np.full(n,-1)
for i in range(m):
    a,b = getLine()
    
    if r[a - 1] == -1:
        r[a - 1] = b
    elif r[a - 1] != b:
        print(-1)
        break
else:
    if (n > 1 and r[0] <= 0) or (n == 1 and r[0] < 0):
        print(-1)
    else:
        print(r)
        r[r == -1] = 0
        print(r)
        r = r.astype(str)
        print(int(''.join(r)))

### FIXED CODE ###

import numpy as np
def getLine():
    return list(map(int, input().split()))
n,m = getLine()
r = np.full(n,-1,dtype=int)
for i in range(m):
    a,b = getLine()
    
    if r[a - 1] == -1:
        r[a - 1] = b
    elif r[a - 1] != b:
        print(-1)
        break
else:
    if n > 1 and r[0] == 0:
        print(-1)
    else:
        if r[0] == 0 and n == 1:
            print('0')
        else:
            if n > 1 and r[0] == -1:
                r[0] = 1
            r[r == -1] = 0
            r = r.astype(str)
            print(''.join(r))
A,B,C=input.split()
a=int(A)
b=int(B)
c=int(C)
if a==b or b==c or a==c:
    if not(a==b and b==c):
        print("Yes")
    else:
        print("No")
else:
    print("No")

### FIXED CODE ###

def is_poor(triple_numbers):
    count_map = {}
    for num in triple_numbers:
        if num not in count_map:
            count_map[num] = 1
        else:
            count_map[num] += 1
    
    for key, value in count_map.items():
        if value == 2:
            return True
    return False

is_p = is_poor(list(map(int, input().split())))

if is_p:
    print("Yes")
else:
    print("No")
print('YES')

### FIXED CODE ###

S = str(input())

circles = 0
crosses = 0

length = len(S)
rest = 15 - length


for i in S:
    if i == 'o':
        circles += 1
    else:
        crosses += 1

if rest + circles >= 8:
    print('YES')
else:
    print('NO')
a=[int(input()) for _ in range(3)]
a.sort()
if a[0]==5 and a[1]==5 and a[2]==7:
  print("YES")
else:
  print("NO")


### FIXED CODE ###

a=list(map(int,input().split()))
print(['NO','YES'][a.count(5)==2 and a.count(7)==1])
mod = 10 ** 9 + 7
class nCr():
    def __init__(self, n):
        self.n = n
        self.fa = [1] * (self.n + 1)
        self.fi = [1] * (self.n + 1)
        for i in range(1, self.n + 1):
            self.fa[i] = self.fa[i - 1] * i % mod
            self.fi[i] = pow(self.fa[i], mod - 2, mod)
    def comb(self, n, r):
        if n < r:return 0
        if n < 0 or r < 0:return 0
        return self.fa[n] * self.fi[r] % mod * self.fi[n - r] % mod
n, m, k = map(int, input().split())
ans = 0
c = nCr(n + m)
for i in range(n):
    ans += i * (n - i) * m * m
    ans %= mod
for i in range(m):
    ans += i * (m - i) * n * n
    ans %= mod
print(ans * c.comb(n * m - 2, k - 2) % mod)

### FIXED CODE ###

mod = 10 ** 9 + 7
class nCr():
    def __init__(self, n):
        self.n = n
        self.fa = [1] * (self.n + 1)
        self.fi = [1] * (self.n + 1)
        for i in range(1, self.n + 1):
            self.fa[i] = self.fa[i - 1] * i % mod
            self.fi[i] = pow(self.fa[i], mod - 2, mod)
    def comb(self, n, r):
        if n < r:return 0
        if n < 0 or r < 0:return 0
        return self.fa[n] * self.fi[r] % mod * self.fi[n - r] % mod
n, m, k = map(int, input().split())
ans = 0
c = nCr(n * m)
for i in range(n):
    ans += i * (n - i) * m * m
    ans %= mod
for i in range(m):
    ans += i * (m - i) * n * n
    ans %= mod
print(ans * c.comb(n * m - 2, k - 2) % mod)
N, M = map(int, input().split())
dp = [0] * N
for _ in range(M):
    a = int(input())
    dp[a-1] = -1

k = 1000000007


for i in range(N):
    if dp[i] == -1:
        dp[i] = 0
        continue
    if i == 0:
        dp[i] = 1
        continue
    if i == 1:
        dp[i] = dp[i-1] + 1
        continue

    dp[i] = dp[i-1] + dp[i-2]
    dp[i] /= k



print(n)


### FIXED CODE ###

N, M = map(int, input().split())
dp = [0] * N
for _ in range(M):
    a = int(input())
    dp[a-1] = -1

k = 1000000007


for i in range(N):
    if dp[i] == -1:
        dp[i] = 0
        continue
    if i == 0:
        dp[i] = 1
        continue
    if i == 1:
        dp[i] = dp[i-1] + 1
        continue

    dp[i] = dp[i-1] + dp[i-2]

n = dp[-1] % k

print(n)
def num_of_1bit(n: int)->int:
    s = 0
    while n > 0:
        s += n & 1
        n >>= 1
    return s


def diff_by_1_bit(N: int, A: int, B: int)->list:
    num_A = num_of_1bit(A)
    num_B = num_of_1bit(B)
    if abs(num_A - num_B) & 1 == 1:
        raise Exception('')
    else:
        return []


if __name__ == "__main__":
    N, A, B = map(int, input().split())
    ans = diff_by_1_bit(N, A, B)
    if len(ans) == 0:
        print('NO')
    else:
        print('YES')
        print(' '.join(map(str, ans)))


### FIXED CODE ###

def num_of_1bit(n: int)->int:
    '''n の立っているビットを数えます。
    :param n: number
    :return: number of 1 bit
    '''
    s = 0
    while n > 0:
        s += n & 1
        n >>= 1
    return s


def diff_idx(a: int, b: int)->int:
    '''a と b のビット列を比較してビットの状態が異なる最小の
    インデックスを返します。ここで、インデックスは 2^i の i 
    に対応する。
    :param a: number 1
    :param b: number 2
    :return: index
    '''
    if a == b:
        return -1
    idx = 0
    while a > 0 or b > 0:
        if a & 1 != b & 1:
            break
        idx += 1
        a, b = a >> 1, b >> 1
    return idx


def remove_bit(n: int, idx: int)->int:
    '''n の idx 番目のビットを消去します。idx は 2^idx に対
    応します。
    ex) n = 1011011, idx = 2
    -> 101111

    :param n: number
    :param idx: index
    :return: number removed `idx`th bit
    '''
    upper = (n >> (idx+1)) << idx
    lower = n & ((1 << idx) - 1)
    return upper | lower


def insert_bit(n: int, idx: int, bit: bool)->int:
    '''n の idx 番目にビットを挿入します。
    ex) n = 101111, idx = 2, bit = True
    -> 1011111
    '''
    upper = (n >> idx) << (idx + 1)
    lower = n & ((1 << idx) - 1)
    insert = bit << idx
    return upper | insert | lower


def route(_from: int, to: int, N: int)->list:
    '''_from から to に至る N ビットの数を全て使ったルートを
    計算します。
    :param _from: start
    :param to: end
    :param N: number of bit
    :return: routes
    '''
    if N == 1:
        return [_from, to]

    di = diff_idx(_from, to)

    a = remove_bit(_from, di)
    b = remove_bit(to, di)
    c = a ^ 1

    from_bit = (_from & (1 << di)) != 0
    to_bit = (to & (1 << di)) != 0

    first_half = map(lambda x: insert_bit(x, di, from_bit), route(a, c, N-1))
    second_half = map(lambda x: insert_bit(x, di, to_bit),  route(c, b, N-1))

    return list(first_half) + list(second_half)


def diff_by_1_bit(N: int, A: int, B: int)->list:
    num_A = num_of_1bit(A)
    num_B = num_of_1bit(B)
    if abs(num_A - num_B) % 2 == 0:
        return []

    return route(A, B, N)


if __name__ == "__main__":
    N, A, B = map(int, input().split())
    ans = diff_by_1_bit(N, A, B)
    if len(ans) == 0:
        print('NO')
    else:
        print('YES')
        print(' '.join(map(str, ans)))
s = input()
if s in t = input() * 2:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s = input()
if s in input() * 2:
  print('Yes')
else:
  print('No')
n=int(input())
l=map(int, input().split())
# n=5
# l=[4,2,5,1,3]
count=0
for i in range(1,len(l)+1):
#     print(l[:i])
#     print(l[i-1])
    if min(l[:i])==l[i-1]:
        count+=1
    
    
    
print(count)

### FIXED CODE ###

n=int(input())
l=list(map(int, input().split()))
# n=5
# l=[4,2,5,1,3]
count=0

import heapq

tmp=l[0]
for i in range(1,len(l)+1):
    if tmp>=l[i-1]:
        count+=1
        tmp=l[i-1]
    
    
print(count)
from decimal import Decimal

A, B = list(map(float, input().split()))

ans = Decimal(A) * Decimal(B)

print(floor(ans))

### FIXED CODE ###

from math import floor
from decimal import Decimal

A, B = list(input().split())

ans = int(A) * Decimal(B)

print(floor(ans))
# coding: utf-8
import numpy as np

f = 1
n, m = map(int, input().split())

li = [-1] * n

for _ in range(m):
    s, c = map(int, input().split())
    if li[s-1] != -1 and li[s-1] != c:
        f = 0
        break
    else:
        li[s-1] = c

if li[0] == -1 or li[0] == 0:
    f = 0
else:
    while -1 in li:
        li[li.index(-1)] = 0

if f:
    for i in range(n):
        print(li[i], end='')
    print('')
else:
    print('-1')

### FIXED CODE ###

# coding: utf-8

f = 1
n, m = map(int, input().split())

li = [-1] * n

for _ in range(m):
    s, c = map(int, input().split())
    if li[s-1] != -1 and li[s-1] != c:
        f = 0
        break
    else:
        li[s-1] = c

if n > 1 and li[0] == 0:
    f = 0
else:
    if -1 in li and li.index(-1) == 0:
        if n > 1:
            li[0] = 1
        else:
            li[0] = 0
    while -1 in li:
        li[li.index(-1)] = 0

if f:
    for i in range(n):
        print(li[i], end='')
    print('')
else:
    print('-1')
N, M = map(int, input().split())
print('Yes' if N==M else 'No)

### FIXED CODE ###

N, M = map(int, input().split())
print('Yes' if N==M else 'No')
_input = input
#'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

#ここに書きたいコードを書く
#データ読み込み

N=int(input())
S=input()

RGB_num=[0]*3

for c in S:
	if c=='R':
		RGB_num[0] += 1
	elif c=='G':
		RGB_num[1] += 1
	else:
		RGB_num[2] += 1

#print(RGB_num)
joken2=0

print(S[0])
for i in range(N-2):
	#print("i",i,S[i+1])
	for j in range(min(i+1,N-i-2)):
		if S[i+1] != S[i-j] and S[i+1] != S[i+j+2] and S[i-j] != S[i+j+2]:
			joken2 += 1
			#print(i,j,S[i-j]+S[i+1]+S[i+j+2],"j2")
		#else:
			#print(i,j,S[i-j]+S[i+1]+S[i+j+2])

joken1=RGB_num[0]*RGB_num[1]*RGB_num[2]

print(joken1-joken2)

input = _input


### FIXED CODE ###

_input = input
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

#ここに書きたいコードを書く
#データ読み込み

N=int(input())
S=input()

RGB_num=[0]*3

for c in S:
	if c=='R':
		RGB_num[0] += 1
	elif c=='G':
		RGB_num[1] += 1
	else:
		RGB_num[2] += 1

#print(RGB_num)
joken2=0

for i in range(N-2):
	#print("i",i,S[i+1])
	for j in range(min(i+1,N-i-2)):
		if S[i+1] != S[i-j] and S[i+1] != S[i+j+2] and S[i-j] != S[i+j+2]:
			joken2 += 1
			#print(i,j,S[i-j]+S[i+1]+S[i+j+2],"j2")
		#else:
			#print(i,j,S[i-j]+S[i+1]+S[i+j+2])

joken1=RGB_num[0]*RGB_num[1]*RGB_num[2]

print(joken1-joken2)

input = _input
# 何本の数直線上にあるかを求める　1<=ans<=n-1
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
# xy.sort(key=lambda x:x[0])
# print(xy)
diff=[]
for i in range(n):
    for j in range(i):
        diff.append((xy[i][0]-xy[j][0],xy[i][1]-xy[j][1]))

ans=[]
# print(set(diff))
for p,q in set(diff):
    qxHIKUpy=[]
    for i in range(n):
        qxHIKUpy.append(q*xy[i][0]-p*xy[i][1])
    ans.append(len(set(qxHIKUpy)))
# print(ans)
print(min(ans))


### FIXED CODE ###

n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
xy.sort(key=lambda x:(x[0],x[1]))
# print(xy)
if n<=2:
    print(1)
else:
    diff=[]
    for i in range(n):
        for j in range(i):
            diff.append((xy[i][0]-xy[j][0],xy[i][1]-xy[j][1]))

    ans=[]
    # print(set(diff))
    for p,q in set(diff):
        cnt=n
        for i in range(n):
            for j in range(i):
                if xy[i][0]-xy[j][0]==p and xy[i][1]-xy[j][1]==q:
                    cnt-=1
        ans.append(cnt)
    print(min(ans))
A, B, C = map(int, input().split())
  
 if A <= C and C <= B:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

A, B, C = map(int, input().split())
if A <= C and C <= B:
    print("Yes")
else:
    print("No")
N, M = map(int, input().split())
like_set = {}
for i in range(1,M+1):
    like_set = like_set | {i}
for i in range(N):
    k_a = input().split()
    a = k_a[1:]
    like_set = set(a) & like_set
print(len(like_set))


### FIXED CODE ###

N, M = map(int, input().split())
like_set = {0}
for i in range(1, M+1):
    like_set.add(i)
for i in range(N):
    like = list(map(int,input().split()))
    like = set(like[1:])
    like_set = like_set & like
print(len(like_set))
N, X = map(int, input().split())
M = [int(input()) for _ in range(N)]
ans = 0
for m in range(M):
    X -= m
    ans += 1
ans += X // min(M)
print(ans)


### FIXED CODE ###

N, X = map(int, input().split())
M = [int(input()) for _ in range(N)]
ans = 0
for m in M:
    X -= m
    ans += 1
ans += X // min(M)
print(ans)
inp = input().split
inp = [int(x) for x in inp]
print(inp[0]/inp[1], end=' ')
print(inp[0]%inp[1], end=' ')
print(inp[0]/float(inp[1]))

### FIXED CODE ###

inp = input().split()
inp = [int(x) for x in inp]
print(int(inp[0]/inp[1]), end=' ')
print(inp[0]%inp[1], end=' ')
print('{:f}'.format(inp[0]/float(inp[1])))
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

class WarshallFloyd():
    def __init__(self, N):
        self.N = N
        self.d = [[float("inf") for i in range(N)]
                  for i in range(N)]  # d[u][v] : 辺uvのコスト(存在しないときは'inf')

    def add(self, u, v, c, directed=False):
        """
        0-indexedであることに注意
        u = from, v = to, c = cost
        directed = Trueなら、有向グラフである
        """
        if directed is False:
            self.d[u][v] = c
            self.d[v][u] = c
        else:
            self.d[u][v] = c

    def WarshallFloyd_search(self):
        # これを d[i][j]: iからjへの最短距離 にする
        # 本来無向グラフでのみ全域木を考えるが、二重辺なら有向でも行ける
        for k in range(self.N):
            for i in range(self.N):
                for j in range(self.N):
                    self.d[i][j] = min(
                        self.d[i][j], self.d[i][k] + self.d[k][j])
        for i in range(self.N):
            self.d[i][i] = 0
        return self.d

n,m = na()
g = WarshallFloyd(n)
abc = []

for i in range(m):
    a,b,c = na()
    g.add(a,b,c)
    abc.append([a,b,c])

dp = g.WarshallFloyd_search()

ans = 0
for a,b,c in abc:
    if dp[a][b] < c:
        ans += 1

print(ans)

### FIXED CODE ###

import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

class WarshallFloyd():
    def __init__(self, N):
        self.N = N
        self.d = [[float("inf") for i in range(N)]
                  for i in range(N)]  # d[u][v] : 辺uvのコスト(存在しないときは'inf')

    def add(self, u, v, c, directed=False):
        """
        0-indexedであることに注意
        u = from, v = to, c = cost
        directed = Trueなら、有向グラフである
        """
        if directed is False:
            self.d[u][v] = c
            self.d[v][u] = c
        else:
            self.d[u][v] = c

    def WarshallFloyd_search(self):
        # これを d[i][j]: iからjへの最短距離 にする
        # 本来無向グラフでのみ全域木を考えるが、二重辺なら有向でも行ける
        for k in range(self.N):
            for i in range(self.N):
                for j in range(self.N):
                    self.d[i][j] = min(
                        self.d[i][j], self.d[i][k] + self.d[k][j])
        for i in range(self.N):
            self.d[i][i] = 0
        return self.d

n,m = na()
g = WarshallFloyd(n)
abc = []

for i in range(m):
    a,b,c = na()
    g.add(a-1,b-1,c)
    abc.append([a-1,b-1,c])

dp = g.WarshallFloyd_search()

ans = 0
for a,b,c in abc:
    if dp[a][b] < c:
        ans += 1

print(ans)
a,b,c=(int(x) for x in input().split())

if a == b or a == c or b == c:
  print(yes)
  
else:
  print(no)

### FIXED CODE ###

a,b,c=(int(x) for x in input().split())
 
if a == b or a == c or b == c:
    if a == b == c:
        print("No")
    else:
        print("Yes")
  
else:
  print("No")
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
print("No War" if min(a)<=x<=max(a) and min(b)<=y<=max(b) and max(a) =<min(b) else "War")

### FIXED CODE ###

n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
a.append(x)
b=list(map(int,input().split()))
b.append(y)
print("No War" if max(a)<min(b) else "War")
# ABC150C - Count Order
from itertools import permutations


def main():
    N, *PQ = map(int, open(0).read().split())
    P, Q = PQ[:N], PQ[N:]
    perms = list(permutations(range(1, N + 1), N))
    ans = abs(perms.index(P) - perms.index(Q))
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

# ABC150C - Count Order
from itertools import permutations


def main():
    N, *PQ = map(int, open(0).read().split())
    P, Q = PQ[:N], PQ[N:]
    a, b = 0, 0
    for i, perm in enumerate(permutations(range(1, N + 1), N), 1):
        perm = list(perm)
        if perm == P:
            a = i
        if perm == Q:
            b = i
    ans = abs(a - b)
    print(ans)


if __name__ == "__main__":
    main()
x, a, b = map(int, input().split())
if a-b => 0 :
  print('delicious')
elif b-a <= x:
  print('safe')
else:
  print('dangerous')


### FIXED CODE ###

x, a, b = map(int, input().split())
if a-b >= 0 :
  print('delicious')
elif b-a <= x:
  print('safe')
else:
  print('dangerous')
N, M = map(int, input().split())
acc = [False] * N
pen = 0
for _ in range(M):
  p, S = input().split()
  p = int(p) - 1
  if S[0] == 'A':
    acc[p] = True
  else:
  	if not acc[p]:
      pen += 1
print('{} {}'.format(sum(acc), pen))


### FIXED CODE ###

import numpy as np

def main():
    N, M = map(int, input().split())
    PS = {}
    for i in range(M):
        row = input().split()
        row[0] = int(row[0])
        if row[0] not in PS:
            PS[row[0]] = [row[1]]
        else:
            PS[row[0]].append(row[1])

    n_correct = 0
    n_penalty = 0
    for p in PS:
        if 'AC' in PS[p]:
            n_correct += 1
            for result in PS[p]:
                if result == 'AC':
                    break
                if result == 'WA':
                    n_penalty += 1
    
    print('{} {}'.format(n_correct, n_penalty))
        


if __name__ == '__main__':
    main()
n = int(input())
x = list(map(int, input().split()))
ans = x[0]
if 0 in x:
	ans = 0
else:
	for i in range(1,n):
		ans = ans * x[i]
		if ans > 10 ** 18:
			ans = -1
            break
print(ans)

### FIXED CODE ###

n = int(input())
x = list(map(int, input().split()))
ans = x[0]
if 0 in x:
	ans = 0
else:
	for i in range(1,n):
		ans = ans * x[i]
		if ans > 10 ** 18:
			ans = -1
			break
print(ans)
N, A, B = map.(int, input().split())

if N * A >= B:
    print(B)
else:
    print(N * A)


### FIXED CODE ###

N, A, B = map(int, input().split())

if N * A >= B:
    print(B)
else:
    print(N * A)
N, A, B = int(input().split())
print(min(N*A,B))

### FIXED CODE ###

N, A, B = map(int, input().split())
print(min(N*A,B))
nums = input().split()
a - int(nums[0])
b = int(nums[1])
print(a*b,(a+b)*2)

### FIXED CODE ###

nums = input().split()
a = int(nums[0])
b = int(nums[1])
print(a * b,(a + b) * 2)
n = int(input())
m = [int(input()) for i in range(n)]
mso = sorted(m)
count = 0
for s in range(1,n):
  if mso[s] == mso[s-1]
    count += 1
print(n-count)

### FIXED CODE ###

n = int(input())
m = [int(input()) for i in range(n)]
mso = sorted(m)
count = 0
for s in range(1,n):
  if mso[s] == mso[s-1]:
    count += 1
print(n-count)
A*B

### FIXED CODE ###

a,b = (int(x) for x in input().split())
print(a*b)
n = int(input())
time = []
point = []
for _ in range(n):
    time_point = list(map(int, input().split()))
    time.append(time_point[0])
    point.append(time_point[1:])

direction = [[1, 0], [-1, 0], [0, 1], [0, -1]]
moved = [[] for _ in range(time[-1] + 1)]

def dfs(t, x, y, dx, dy):
    nx = x + dx
    ny = y + dy
    if [nx, ny] in moved[t]:
        return 0
    moved[t].append([nx, ny])
    if [nx, ny] != point_dict.get(t, [nx, ny]):
        return 0
    if t == time[-1]:
        return 1
    else:
        return dfs(t+1, nx, ny, *direction[0]) + dfs(t+1, nx, ny, *direction[1]) + dfs(t+1, nx, ny, *direction[2]) + dfs(t+1, nx, ny, *direction[3])
        
for i in range(4):
    if dfs(1, 0, 0, *direction[i]) >= 1:
        print('Yes')
        break
else:
    print('No')

### FIXED CODE ###

n = int(input())
t=x=y=0
ans = 'Yes'
for _ in range(n):
    nt, nx, ny = map(int, input().split())
    dis = abs(nx - x) + abs(ny - y)
    time = nt - t
    if dis <= time and dis%2 == time%2:
        t = nt
        x, y = nx, ny
        continue
    else:
        ans = 'No'
print(ans)
#include <stdio.h>
int main(void) {
	char in[201], tmp[201];
	int m, n, i, j;

	while (1) {
		scanf("%200s ", in);
		if (in[0] == '-')
			break;

		scanf("%d ", &m);
		while (m--) {
			scanf("%d ", &n);
			for (i = 0; in[i+n] != '\0'; i++) {
				tmp[i] = in[i+n];
			}
			for (j = 0; j < n; j++) {
				tmp[i+j] = in[j];
			}
			tmp[i+j] = '\0';
			for (i = 0; tmp[i] != '\0'; i++) {
				in[i] = tmp[i];
			}
		}
		puts(in);
	}
	return 0;
}

### FIXED CODE ###

from __future__ import division, print_function
from sys import stdin
while True:
    cards = stdin.readline().rstrip()
    if cards.startswith('-'):
        break
    for _ in range(int(stdin.readline())):
        n = int(stdin.readline())
        cards = cards[n:] + cards[:n]
    print(cards)
n = int(input())
s = input()
hs = [ int(i) for i in s.rsplit() ]

max = 0
for i in range(len(hs)):
    lmax = 0
    for k in range(1, len(hs)-i):
        if hs[i+k] <= hs[i+k-1]:
            lmax = lmax + 1
        else:
            break

        if lmax > max:
            max = lmax

print(max)

### FIXED CODE ###

import math
A, B = input().split()
A = int(A)
B = int(B)
n = math.ceil((B-1)/(A-1))
print(n)
from functools import reduce
from math import gcd

n = int(input())
clocks = []
for i in range(n):
    clocks.append(int(input()))
print(reduce(lambda x, y: (x * y) // gcd(x, y), clocks))


### FIXED CODE ###

from functools import reduce
from fractions import gcd

n = int(input())
clocks = []
for i in range(n):
    clocks.append(int(input()))
print(reduce(lambda x, y: (x * y) // gcd(x, y), clocks))