Buggy python submission (verdict: Runtime Error):
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s= [[[] for j in range(26)] for i in range(26)]
sum=0
for i in range(x):
    si=ns()
    sn1=ord(si[0:1])-97
    sn2=ord(si[1:2])-97
    if si not in s[sn1][sn2]:
       s[sn1][sn2].append(si)
for s1 in s:
    for s2 in s1:
        sum+=len(s2)
print(sum)

Fixed submission:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s= [[[] for j in range(26)] for i in range(26)]
sum=0
for i in range(x):
    si=ns()
    sn1=ord(si[0:1])-97
    if len(si)==1:
        sn2=0
    else:
        sn2 = ord(si[1:2]) - 97
    if si not in s[sn1][sn2]:
       s[sn1][sn2].append(si)
for s1 in s:
    for s2 in s1:
        sum+=len(s2)
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s= [[] for i in range(26)]
sum=0
for i in range(x):
    si=ns()
    sn=ord(si[0:1])-97
    if si not in s[sn]:
       s[sn].append(si)
for s1 in s:
    sum+=len(s1)
print(sum)

Fixed submission:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s= [[[] for j in range(26)] for i in range(26)]
sum=0
for i in range(x):
    si=ns()
    sn1=ord(si[0:1])-97
    if len(si)==1:
        sn2=0
    else:
        sn2 = ord(si[1:2]) - 97
    if si not in s[sn1][sn2]:
       s[sn1][sn2].append(si)
for s1 in s:
    for s2 in s1:
        sum+=len(s2)
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s=[[],[],[],[],[],[],[],[],[],[]]
sum=0
for i in range(x):
    si=ns()
    sn=len(si)-1
    if si not in s[sn]:
        s[sn].append(si)
for s1 in s:
    sum+=len(s1)
print(sum)

Fixed submission:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s= [[[] for j in range(26)] for i in range(26)]
sum=0
for i in range(x):
    si=ns()
    sn1=ord(si[0:1])-97
    if len(si)==1:
        sn2=0
    else:
        sn2 = ord(si[1:2]) - 97
    if si not in s[sn1][sn2]:
       s[sn1][sn2].append(si)
for s1 in s:
    for s2 in s1:
        sum+=len(s2)
print(sum)

Buggy python submission (verdict: Runtime Error):
import sys
import collections
import math

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s=[[],[],[],[],[],[],[],[],[],[]]
sum=0
for i in range(x):
    si=ns()
    sn=len(si)
    if si not in s[sn]:
        s[sn].append(si)
for s1 in s:
    sum+=len(s1)
print(sum)

Fixed submission:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s= [[[] for j in range(26)] for i in range(26)]
sum=0
for i in range(x):
    si=ns()
    sn1=ord(si[0:1])-97
    if len(si)==1:
        sn2=0
    else:
        sn2 = ord(si[1:2]) - 97
    if si not in s[sn1][sn2]:
       s[sn1][sn2].append(si)
for s1 in s:
    for s2 in s1:
        sum+=len(s2)
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections
import math

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s=[]
for i in range(x):
    si=ns()
    if si not in s:
        s.append(si)
print(len(s))


Fixed submission:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


x = ni()
s= [[[] for j in range(26)] for i in range(26)]
sum=0
for i in range(x):
    si=ns()
    sn1=ord(si[0:1])-97
    if len(si)==1:
        sn2=0
    else:
        sn2 = ord(si[1:2]) - 97
    if si not in s[sn1][sn2]:
       s[sn1][sn2].append(si)
for s1 in s:
    for s2 in s1:
        sum+=len(s2)
print(sum)