Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 1
for i in range(2,i+1):
  ans = ans * i % (10 ** 9 + 7)

print(ans)

Fixed submission:
N = int(input())
ans = 1
for i in range(2,N+1):
  ans = ans * i % (10 ** 9 + 7)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 1

for i in range(2,N+1):
	ans *= i
print(ans % (10 ** 9 + 7))

Fixed submission:
N = int(input())
ans = 1
for i in range(2,N+1):
  ans = ans * i % (10 ** 9 + 7)

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
def per(N):
    if N == 0 or N == 1:
        return 1
    else:
        return N * per(N-1)

print(per(N) % (10 ** 9 + 7))

Fixed submission:
N = int(input())
ans = 1
for i in range(2,N+1):
  ans = ans * i % (10 ** 9 + 7)

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
def per(N):
  return N * per(N-1)

print(per(N) / (10 ** 9 + 7))

Fixed submission:
N = int(input())
ans = 1
for i in range(2,N+1):
  ans = ans * i % (10 ** 9 + 7)

print(ans)
Buggy python submission (verdict: Runtime Error):
N,M = [int(i) for i in input().split()]
count = 0
if 2 * N <= M:
    count = N
    M -= 2 * N
    if M >= 4:
        count += M // 4
        print(count)
    else:
        print(count)
else:
    if N != 0:
        while N == 0 or M <= 1:
            count += 1
            N -= 1
            M - = 2
        print(count)
    else:
        print(count)


Fixed submission:
N,M = [int(i) for i in input().split()]
count = 0
if 2 * N <= M:
    count = N + (M - 2 * N) // 4
else:
    count = M // 2

print(count)

Buggy python submission (verdict: Runtime Error):
N,M = [int(i) for i in input().split()]
count = 0
if 2 * N <= M:
    count = N
    M -= 2 * N
    if M >= 4:
        count += M // 4
        print(count)
    else:
        print(count)
else:
    if N != 0:
        while N == 0 or M <= 1:
            count += 1
            N -= 1
            M - = 2
        print(count)
    else:
        print(count)


Fixed submission:
N,M = [int(i) for i in input().split()]
count = 0
if 2 * N <= M:
    count = N + (M - 2 * N) // 4
else:
    count = M // 2

print(count)
Buggy python submission (verdict: Runtime Error):
A = input()
for i in range(len(A)):
  if A[i] == ',':
    A[i] = ''

print(A)

Fixed submission:
A = input()
A = A.replace(',',' ')

print(A)
Buggy python submission (verdict: Time Limit Exceeded):
N,x = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
count = 0

while a[0] > x:
    a[0] -= 1
    count += 1

for i in range(N-1):
    while a[i] + a[i+1] > x:
        a[i+1] -= 1
        count += 1
        
print(count)


Fixed submission:
N,x = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
count = 0

while a[0] > x:
    count += a[0] - x
    a[0] = x

for i in range(N-1):
    if a[i] + a[i+1] > x:
        count += a[i+1] - (x - a[i])
        a[i+1] = x - a[i]

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N,x = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
count = 0

for i in range(N-1):
    while a[i] + a[i+1] > x:
        a[i+1] -= 1
        count += 1

print(count)


Fixed submission:
N,x = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
count = 0

while a[0] > x:
    count += a[0] - x
    a[0] = x

for i in range(N-1):
    if a[i] + a[i+1] > x:
        count += a[i+1] - (x - a[i])
        a[i+1] = x - a[i]

print(count)
Buggy python submission (verdict: Runtime Error):
xmax,ymax,N = [int(i) for i in input().split()]
x,y,a = list(map(int,input().split()))
xmin = 0
ymin = 0

for i in range(N):
    if a[i] == 1:
        if xmin < x[i]:
            xmin = x[i]
    elif a[i] == 2:
        if xmax > x[i]:
            xmax = x[i]
    elif a[i] == 3:
        if ymin < y[i]:
            ymin = y[i]
    elif a[i] == 4:
        if ymax > y[i]:
            ymax = y[i]

if ymax > ymin and xmax > xmin:
    print((ymax - ymin)*(xmax - xmin))
else:
    print(0)

Fixed submission:
W,H,N = [int(i) for i in input().split()]
A = [list(map(int, input().split())) for i in range(N)]

x1,y1 = 0,0
x2 = W
y2 = H

for i in range(N):
    if A[i][2] == 1:
        if x1 < A[i][0]:
            x1 = A[i][0]
    elif A[i][2] == 2:
        if x2 > A[i][0]:
            x2 = A[i][0]
    elif A[i][2] == 3:
        if y1 < A[i][1]:
            y1 = A[i][1]
    elif A[i][2] == 4:
        if y2 > A[i][1]:
            y2 = A[i][1]

if (x2-x1) > 0 and (y2-y1) > 0:
    print((x2-x1)*(y2-y1))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
a = [int(i) for i in input().split()]
print(len(set(a))

Fixed submission:
a = [int(i) for i in input().split()]
print(len(set(a)))
Buggy python submission (verdict: Runtime Error):
A = str(input())
B = str(input())
C = str(input())
na = int()
nb = int()
nc = int()
n = 'a'

while na < len(A)+1 and nb < len(B)+1 and nc < len(C)+1:
    if n == 'a':
        if A[na] == 'a':
            na += 1
            n = 'a'
        elif A[na] == 'b':
            na += 1
            n = 'b'
        elif A[na] == 'c':
            na += 1
            n = 'c'
    if n == 'b':
        if B[nb] == 'a':
            nb += 1
            n = 'a'
        elif B[nb] == 'b':
            nb += 1
            n = 'b'
        elif B[nb] == 'c':
            nb += 1
            n = 'c'
    if n == 'c':
        if C[nc] == 'a':
            nc += 1
            n = 'a'
        elif C[nc] == 'b':
            nc += 1
            n = 'b'
        elif C[nc] == 'c':
            nc += 1
            n = 'c'

print(n)


Fixed submission:
from collections import deque
A = deque(list(input()+'A'))
B = deque(list(input()+'B'))
C = deque(list(input()+'C'))

x = A.popleft()
while(True):
    if x == 'a':
        x = A.popleft()
    elif x == 'b':
        x = B.popleft()
    elif x == 'c':
        x = C.popleft()
    else:
        break

print(x)

Buggy python submission (verdict: Runtime Error):
A = str(input())
B = str(input())
C = str(input())
na = int()
nb = int()
nc = int()
n = 'a'

while na < len(A)+1 and nb < len(B)+1 and nc < len(C)+1:
    if n == 'a':
        if A[na] == 'a':
            na += 1
            n = 'a'
        elif A[na] == 'b':
            nb += 1
            n = 'b'
        elif A[na] == 'c':
            nc += 1
            n = 'c'
    if n == 'b':
        if A[nb] == 'a':
            na += 1
            n = 'a'
        elif A[nb] == 'b':
            nb += 1
            n = 'b'
        elif A[nb] == 'c':
            nc += 1
            n = 'c'
    if n == 'c':
        if A[nc] == 'a':
            na += 1
            n = 'a'
        elif A[nc] == 'b':
            nb += 1
            n = 'b'
        elif A[nc] == 'c':
            nc += 1
            n = 'c'

print(n)

Fixed submission:
from collections import deque
A = deque(list(input()+'A'))
B = deque(list(input()+'B'))
C = deque(list(input()+'C'))

x = A.popleft()
while(True):
    if x == 'a':
        x = A.popleft()
    elif x == 'b':
        x = B.popleft()
    elif x == 'c':
        x = C.popleft()
    else:
        break

print(x)
Buggy python submission (verdict: Runtime Error):
N,K = [int(i) for i in input().split()]
#D = [int(i) for i in input().split()]は数値代入
#文字列を複数代入
D = input().split()
#集合に置き換える(型はset)
D = set(D)
use = set(['0','1','2','3','4','5','6','7','8','9'])
use -= D

for i in range(N,10001):
    if use >= set(str(i)):
        print(i)
        break


Fixed submission:
A,B,C = [int(i) for i in input().split()]
list = [A,B,C]
go = 0
nana = 0
for i in list:
  if i == 5:
    go += 1
  if i == 7:
    nana += 1

if go == 2 and nana == 1:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
A,B,C = [int(i) for i in input().split()]
list = [A,B,C]

for i in list:
  if i == 5:
    go += 1
  if i == 7:
    nana += 1

if go == 2 and nana == 1:
  print("YES")
else:
  print("NO")

Fixed submission:
A,B,C = [int(i) for i in input().split()]
list = [A,B,C]
go = 0
nana = 0
for i in list:
  if i == 5:
    go += 1
  if i == 7:
    nana += 1

if go == 2 and nana == 1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
A_list = []

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

for i in range(3):
  a, b, c = map(int, input().split())
  A_list.append(a)
  A_list.append(b)
  A_list.append(c)

N = int(input())
flag=True

for i in range(N):
  num = int(input())

  tmp = my_index(A_list, num)
  if tmp != False or tmp == 0:
    A_list[tmp] = -1
  
  if ((A_list[0] == A_list[3]) and (A_list[0] == A_list[6]) and (A_list[3] == A_list[6])) or ((A_list[1] == A_list[4]) and (A_list[1] == A_list[7]) and (A_list[4] == A_list[7])) or ((A_list[2] == A_list[5]) and (A_list[2] == A_list[8]) and (A_list[5] == A_list[8])) or ((A_list[0] == A_list[4]) and (A_list[0] == A_list[8]) and (A_list[4] == A_list[8])) or ((A_list[2] == A_list[4]) and (A_list[2] == A_list[6]) and (A_list[4] == A_list[6])) or ((A_list[0] == A_list[1]) and (A_list[0] == A_list[2]) and (A_list[1] == A_list[2])) or ((A_list[3] == A_list[4]) and (A_list[3] == A_list[5]) and (A_list[4] == A_list[5])) or ((A_list[6] == A_list[7]) and (A_list[6] == A_list[8]) and (A_list[7] == A_list[8])):
    print("Yes")
    flag=False
    break

if flag:
  print("No")


Fixed submission:
N, M = map(int, input().split())
num_list = [0]*N

flag=True

for _ in range(M):
  s, c = map(int, input().split())

  if (s == 1 and c == 0 and N != 1):
    print(-1)
    flag=False
    break

  if (num_list[s-1] == 0):
    num_list[s-1] = c
  else:
    if num_list[s-1] != c:
      print(-1)
      flag=False
      break

if flag:
  if num_list[0] == 0 and N != 1:
    num_list[0] = 1

  ans = ""
  for i in num_list:
    ans += str(i)

  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = [int(i) for i in input().split(" ")]

result = "YES"
for i in range(0, N-1):
  for j in range(i+1, N):
    if A_list[i] == A_list[j]:
      result = "NO"
      break
  if result == "NO":
    break

print(result)


Fixed submission:
N = int(input())
A_list = [int(i) for i in input().split(" ")]
B_list = list(set(A_list))

if len(A_list) == len(B_list):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
a = int(input())

key = True
for i in range(1, 10):
  for j in range(1, 10):
    if(a == i * j):
      print('YES')
      key = False
  if(!key):
    break
if(key):
  print('NO')

Fixed submission:
a = int(input())

key = True
for i in range(1, 10):
  for j in range(1, 10):
    if(a == i * j and key):
      print('Yes')
      key = False
if(key):
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
for i in range(0, N):
  A.append(int(input()))

for j in range(0, N):
  list = A[:j] + A[j+1:]
  print(max(list))

Fixed submission:
N = int(input())
max_1st = -1
max_1st_index = -1
max_2nd = -1
only_max = False
for i in range(0, N):
  if i == 0:
    max_1st = int(input())
    max_1st_index = 0
  elif i == 1:
    tmp = int(input())
    if (tmp > max_1st):
      max_1st, max_2nd = tmp, max_1st
      max_1st_index = 1
    else:
      max_2nd = tmp
  else:
    tmp = int(input())
    if (max_2nd < tmp) and (tmp < max_1st):
      max_2nd = tmp
    elif (max_1st < tmp):
      max_1st, max_1st_index = tmp, i
      only_max = False
    elif (max_1st == tmp):
      only_max = True

for j in range(0, N):
  if only_max:
    print(max_1st)
  else:
    if j == max_1st_index:
      print(max_2nd)
    else:
      print(max_1st)
Buggy python submission (verdict: Runtime Error):
L, R = [int(i) for i in input().split(" ")]

flag=True
if (R - L) >= 2019:
  print(0)
else:
  min_mod = 2019
  for i in range(L, R):
    for j in range(i+1, R+1):
      tmp = (i*j) % 2019
      if tmp == 0:
        print(0)
        flag=False
        break
      elif tmp < min_mod:
        min_mod = tmp
    if flag==False:
      break

if flag==True:
  print(min_mod)

Fixed submission:
L, R = [int(i) for i in input().split(" ")]

flag=True
if (R - L) >= 2019:
  flag=False
  print(0)
else:
  min_mod = 2019
  for i in range(L, R):
    for j in range(i+1, R+1):
      tmp = (i*j) % 2019
      if tmp == 0:
        print(0)
        flag=False
        break
      elif tmp < min_mod:
        min_mod = tmp
    if flag==False:
      break

if flag==True:
  print(min_mod)

Buggy python submission (verdict: Runtime Error):
L, R = [int(i) for i in input().split(" ")]

flag=True
if (R - L) >= 2019:
  print(0)
else:
  min_mod = 2019
  for i in range(L, R):
    for j in range(i+1, R+1):
      tmp = (i*j) % 2019
      if tmp == 0:
        print(0)
        flag=False
        break
      elif tmp < min_mod:
        min_mod = tmp
    if flag==False:
      break

if (flag):
  print(min_mod)

Fixed submission:
L, R = [int(i) for i in input().split(" ")]

flag=True
if (R - L) >= 2019:
  flag=False
  print(0)
else:
  min_mod = 2019
  for i in range(L, R):
    for j in range(i+1, R+1):
      tmp = (i*j) % 2019
      if tmp == 0:
        print(0)
        flag=False
        break
      elif tmp < min_mod:
        min_mod = tmp
    if flag==False:
      break

if flag==True:
  print(min_mod)

Buggy python submission (verdict: Runtime Error):
L, R = [int(i) for i in input().split(" ")]

flag=True
if (R - L) >= 2019:
  print(0)
else:
  min_mod = 2020
  for i in range(L, R):
    for j in range(i+1, R+1):
      tmp = (i*j) % 2019
      if tmp == 0:
        print(0)
        flag=False
        break
      elif tmp < min_mod:
        min_mod = tmp

if (flag):
  print(min_mod)

Fixed submission:
L, R = [int(i) for i in input().split(" ")]

flag=True
if (R - L) >= 2019:
  flag=False
  print(0)
else:
  min_mod = 2019
  for i in range(L, R):
    for j in range(i+1, R+1):
      tmp = (i*j) % 2019
      if tmp == 0:
        print(0)
        flag=False
        break
      elif tmp < min_mod:
        min_mod = tmp
    if flag==False:
      break

if flag==True:
  print(min_mod)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
ans_list = []
for m in range(M):
  a, b = map(int, input().split())

  flag = True
  tmp = {int(i) for i in range(a, b)}
  for i in range(len(ans_list)):
    if ans_list[i] & tmp != set([]):
      ans_list[i] = ans_list[i] & tmp
      flag = False
  if flag:
    ans_list.append(tmp)
print(len(ans_list))


Fixed submission:
N, M = map(int, input().split())
ab_list = []

for _ in range(M):
  a, b = map(int, input().split())
  ab_list.append((a, b))

ab_list.sort(key=lambda x:x[1])

b = -1
ans = 0
for tupl in ab_list:
  if b == -1:
    ans += 1
    b = tupl[1]
  elif b == tupl[1]:
    continue
  elif b != tupl[1]:
    if tupl[0] <= b-1:
      continue
    else:
      ans += 1
      b = tupl[1]
print(ans)
Buggy python submission (verdict: Runtime Error):
from math import gcd

############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
n = inp()
nums = [0] + inlt()
dp = [0 for i in range(n + 1)]
s = [0 for i in range(n + 1)]
s[1] = nums[1]
for i in range(3,n,2):
    s[i] = s[i - 2] + nums[i]
if n == 1:
    print(nums[0])
elif n == 2:
    print(max(nums[1],nums[2]))
elif n == 3:
    print(max(nums[3],nums[1],nums[2]))
elif n == 4:
    print(max(nums[1] + nums[3],nums[1] + nums[4],nums[2] + nums[4]))
else:
    dp[1] = nums[1]
    dp[2] = max(nums[1],nums[2])
    dp[3] = max(nums[3],nums[1],nums[2])
    dp[4] = max(nums[1] + nums[3],nums[1] + nums[4],nums[2] + nums[4])
    for i in range(5,n + 1):
        if i % 2 == 0:
            dp[i] = max(dp[i - 2] + nums[i], s[i - 1]) #if n % 2 == 0 take sum else dp[i - 1]
        else:
            dp[i] = max(dp[i - 2] + nums[i], dp[i - 1])
    print(dp[n])
#print('No')
#print()


Fixed submission:
from math import gcd

############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
n = inp()
nums = [0] + inlt()
dp = [0 for i in range(n + 1)]
s = [0 for i in range(n + 1)]
s[1] = nums[1]
for i in range(3,n,2):
    s[i] = s[i - 2] + nums[i]
if n == 1:
    print(nums[0])
elif n == 2:
    print(max(nums[1],nums[2]))
elif n == 3:
    print(max(nums[3],nums[1],nums[2]))
elif n == 4:
    print(max(nums[1] + nums[3],nums[1] + nums[4],nums[2] + nums[4]))
else:
    dp[1] = nums[1]
    dp[2] = max(nums[1],nums[2])
    dp[3] = max(nums[3],nums[1],nums[2])
    dp[4] = max(nums[1] + nums[3],nums[1] + nums[4],nums[2] + nums[4])
    for i in range(5,n + 1):
        if i % 2 == 0:
            dp[i] = max(dp[i - 2] + nums[i], s[i - 1]) #if n % 2 == 0 take sum else dp[i - 1]
        else:
            dp[i] = max(dp[i - 2] + nums[i], dp[i - 1])
    print(dp[n])
#print('No')
#print()
Buggy python submission (verdict: Runtime Error):
import sys,bisect
from math import gcd
input = sys.stdin.readline
 
############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
s = input().strip()
if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')
#print()

Fixed submission:


############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
s = input().strip()
if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')
#print()

Buggy python submission (verdict: Runtime Error):
import sys,bisect
from math import gcd
input = sys.stdin.readline

############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
s = input().strip()
if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')
#print()


Fixed submission:


############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
s = input().strip()
if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')
#print()
Buggy python submission (verdict: Runtime Error):
import sys,bisect
from math import gcd
input = sys.stdin.readline

############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
n = inp()
remain = n - (n//500)*500

print((n//500)*1000 + 5*(remain//5))
#print()


Fixed submission:


############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
n = inp()
remain = n - (n//500)*500

print((n//500)*1000 + 5*(remain//5))
#print()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [[] for i in range(10)]
count = 0
flag = 0
for i in range(N):
  string = input()
  for s in S[len(string)-1]:
    if string == s:
      flag = 1
      break
  if flag == 0:
    S[len(string)-1].append(string)
    count += 1
  flag = 0
print(count)

Fixed submission:
N = int(input())
S = []
for i in range(N):
  string = input()
  S.append(string)
S = sorted(S)
count = N
for i in range(N-1):
  if S[i] == S[i+1]:
    count -= 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [[] for i in range(10)]
count = 0
for i in range(N):
  string = input()
  if len(S[len(string)-1]) == 0:
    S[len(string)-1].append(string)
    count += 1
  elif not string in S[len(string)-1]:
    S[len(string)-1].append(string)
    count += 1
print(count)

Fixed submission:
N = int(input())
S = []
for i in range(N):
  string = input()
  S.append(string)
S = sorted(S)
count = N
for i in range(N-1):
  if S[i] == S[i+1]:
    count -= 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [[] for i in range(10)]
count = 0
for i in range(N):
  string = input()
  if not string in S[len(string)-1]:
    S[len(string)-1].append(string)
    count += 1
print(count)

Fixed submission:
N = int(input())
S = []
for i in range(N):
  string = input()
  S.append(string)
S = sorted(S)
count = N
for i in range(N-1):
  if S[i] == S[i+1]:
    count -= 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
answer = []
for i in range(N):
  string = input()
  if not string in S:
    S.append(string)
print(len(S))

Fixed submission:
N = int(input())
S = []
for i in range(N):
  string = input()
  S.append(string)
S = sorted(S)
count = N
for i in range(N-1):
  if S[i] == S[i+1]:
    count -= 1
print(count)