ZhenlongDai/ACPR huggingface dataset:
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = []
for i in range(N):
  S.append(input())
T = []
M = int(input())
for j in range(M):
  T.append(input())

S = list(set(S))
T = list(set(T))
count = 0
for i in range(len(S)):
  for j in range(len(T)):
    if S[i] != T[j]:
      count = count + 1
      
print(count)

Failing test case input:
1
voldemort
10
vnldemort
voldemort
tromedlov
voldemort
uoldemort
voldemort
voldemort
voleemort
tromedlov
voldemort

Expected output:
0


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
S = []
for i in range(N):
  S.append(input())
T = []
M = int(input())
for j in range(M):
  T.append(input())

C = []  
for i in range(N):
  count = 0
  for j in range(N):
    if S[i] == S[j]:
      count = count + 1
  for k in range(M):
    if S[i] == T[k]:
      count = count -1
  C.append(count)

print(max(0,(max(C))))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
s=[]
for i in range(N):
    s.append(input())
M=int(input())
t=[]
for i in range(M):
    t.append(input())
res=0
if i in range(N):
    res=max(res, s.count(s[i])-t.count(s[i]))
print(res)

Failing test case input:
6
red
red
blue
ylelox
yellow
red
5
red
ree
yellow
green
blue

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N=int(input())
s=[]
for i in range(N):
    s.append(input())
M=int(input())
t=[]
for i in range(M):
    t.append(input())
res=0
for i in range(N):
    res=max(res, s.count(s[i])-t.count(s[i]))
print(res)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections

n = int(input())
aol = [input() for i in range(n)]
m = int(input())
akal = [input() for j in range(m)]

aod = collections.Counter(aol)
akad = collections.Counter(akal)

l = []
for key in aod:
    if (key in akad) == True:
        sa = aod[key] - akad[key]
        l.append(sa)
    else:
        l.append(aod[key])

print(max(l))

Failing test case input:
1
voldemort
10
vnledmort
voldemort
tromedlov
voldemort
uoldemort
voldemort
voldemort
voleemort
tromedlov
voldemort

Expected output:
0


Actual output:
-4


Fixed submission (verdict: Accepted):
import collections

n = int(input())
aol = [input() for i in range(n)]
m = int(input())
akal = [input() for j in range(m)]

aod = collections.Counter(aol)
akad = collections.Counter(akal)

l = [0]
for key in aod:
    if (key in akad) == True:
        sa = aod[key] - akad[key]
        l.append(sa)
    else:
        l.append(aod[key])

print(max(l))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
d = defaultdict(int)
d["DEFAULT"]=0

n=int(input())
for _ in range(n):
  d[input()]+=1

n=int(input())
for _ in range(n):
  d[input()]-=1
  
print(d[max(d)])

Failing test case input:
3
apole
egnaro
lppae
3
pmpfa
apple
apelp
apple
apple

Expected output:
1


Actual output:
-1


Fixed submission (verdict: Accepted):
from collections import defaultdict
d = defaultdict(int)
d["D"]=0

n=int(input())
for _ in range(n):
  d[input()]+=1

n=int(input())
for _ in range(n):
  d[input()]-=1
  
print(max(d.values()))
Problem: p03408
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
from collections import defaultdict

n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]

d=defaultdict(int)
for x in s:
  d[x]+=1
for y in t:
  d[y]-=1

print(max(d.values()))

Failing test case input:
1
voldemort
10
voldemort
voldemort
voldemort
voldemort
uoldemort
voldemort
voldemort
voleemort
tromedlov
voldemort

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
from collections import defaultdict

n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]

d=defaultdict(int)
for x in s:
  d[x]+=1
for y in t:
  d[y]-=1

print(max(0,max(d.values())))

Problem: p03408
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import Counter

n = int(input())
s = [None] * n
for i in range(n):
    s[i] = input().rstrip()

m = int(input())
t = [None] * m
for i in range(m):
    t[i] = input().rstrip()

ctr = Counter(s) - Counter(t)
if ctr:
    print(ctr.most_common(1)[0][0])
else:
    print(0)

Failing test case input:
1
voldemort
7
vnledmort
vpldemort
tromedlnv
lodvemort
vomdelort
tromedlov
woloeterm
loledvort
volremodt
voldemosv

Expected output:
1


Actual output:
voldemort


Fixed submission (verdict: Accepted):
from collections import Counter

n = int(input())
s = [None] * n
for i in range(n):
    s[i] = input().rstrip()

m = int(input())
t = [None] * m
for i in range(m):
    t[i] = input().rstrip()

ctr = Counter(s) - Counter(t)
if ctr:
    print(ctr.most_common(1)[0][1])
else:
    print(0)

Problem: p03408
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())

ss = []
for _ in range(N):
    ss.append(input())

M = int(input())


ts = []
for _ in range(M):
    ts.append(input())

ans = 1
for s in ss:
    ans = max(ans, ss.count(s) - ts.count(s))

print(ans)

Failing test case input:
1
voldemort
10
vnledmort
voldemort
tromedlov
voldemort
uoldemort
voldemort
voldemort
voleelort
tromedlov
voldemort

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())

ss = []
for _ in range(N):
    ss.append(input())

M = int(input())
ts = []
for _ in range(M):
    ts.append(input())

ans = 0
for s in ss:
    ans = max(ans, ss.count(s) - ts.count(s))

print(ans)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

N=int(input())
s=[input() for i in range(N)]
M=int(input())
t=[input() for i in range(M)]

dict={}
wordlist=list(set(s+t))
ss=Counter(s)
tt=Counter(t)
for i in wordlist:
    cnt=0
    cnt=ss[i]
    cnt=cnt-tt[i]
    dict[i]=cnt

print(max(dict.values()))

Failing test case input:
1
voldemort
8
vnledmort
voldemort
tromedlnv
voldemort
uoldemort
voldemort
woleetorm
voleelort
tromedlov
voldemoru

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
from collections import Counter

N=int(input())
s=[input() for i in range(N)]
M=int(input())
t=[input() for i in range(M)]

wordlist=list(set(s+t))
cnt=0
ss=Counter(s)
tt=Counter(t)
for i in wordlist:
    buf=ss[i]-tt[i]
    if cnt<buf:
      cnt=buf
      
print(cnt)
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = [input() for i in range(N)]
M = int(input())
T = [input() for i in range(M)]

Scores = []
for s in S:
  score = len([s2 for s2 in S if s == s2])
  score -= len([s2 for s2 in T if s == s2])
  Scores.append(score)
print(max(Scores))

Failing test case input:
1
voldemort
7
vnledmort
voldemort
tromedlnv
dolvemort
uoldemort
voldemort
woleetorm
loleevort
tdomerlov
voldemoru

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
N = int(input())
S = [input() for i in range(N)]
M = int(input())
T = [input() for i in range(M)]
 
Scores = []
for s in S:
  score = len([s2 for s2 in S if s == s2])
  score -= len([s2 for s2 in T if s == s2])
  Scores.append(score)
print(max(Scores) if max(Scores)>0 else 0)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
n = int(input())
rec = defaultdict(int)
for i in range(n):
    a = input()
    rec[a] += 1
m = int(input())
for i in range(m):
    a = input()
    rec[a] -= 1

q = -100000
for k, v in rec.items():
    if q <= v:
        q = v

print(q)

Failing test case input:
1
voldemort
7
vnledmort
voldemort
vnldemort
dolvemort
uomdelort
voldemort
woleetorm
loledvort
tdomerlov
voldemosu

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
from collections import defaultdict
n = int(input())
rec = defaultdict(int)
for i in range(n):
    a = input()
    rec[a] += 1
m = int(input())
for i in range(m):
    a = input()
    rec[a] -= 1

q = -100000
for k, v in rec.items():
    if q <= v:
        q = v

print(max(q, 0))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
N = int(input())
s = []
for _ in range(N):
    s.append(input())
M = int(input())
t = []
for _ in range(M):
    t.append(input())
count1 = Counter(s)
count2 = Counter(t)
ans = -1 * M
for key in count1.keys():
    ans = max(ans, count1[key] - count2[key])
print(ans)

Failing test case input:
1
voldemort
7
vnledmort
voldemort
vnldemort
dolvemort
uomdelort
voldemort
woleetorm
loledvort
volremodt
voldemosu

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
from collections import Counter
N = int(input())
s = []
for _ in range(N):
    s.append(input())
M = int(input())
t = []
for _ in range(M):
    t.append(input())
count1 = Counter(s)
count2 = Counter(t)
ans = -1 * M
for key in count1.keys():
    ans = max(ans, count1[key] - count2[key])
ans = max(ans, 0)
print(ans)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
I=lambda:[input()for _ in[0]*int(input())];s=I();t=I();print(max(s.count(i)-t.count(i)for i in set(s)))

Failing test case input:
1
voldemort
7
vnledmort
voldemort
tromedlnv
dolvemort
uomdelort
voldemort
woleetorm
loledvort
tdomerlov
voldemosu

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
I=lambda:[input()for _ in[0]*int(input())];s=I();t=I();print(max([0]+[s.count(i)-t.count(i)for i in set(s)]))
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
word={}
for i in range(n):
    new=input()
    if new in word:
        word[new]+=1
    else:
        word[new]=1
m=int(input())
for i in range(m):
    new=input()
    if new in word:
        word[new]-=1
    else:
        word[new]=-1
        
print(max(word.values()))

Failing test case input:
1
voldemort
10
vnledmort
voldemort
tromedlnv
voldemort
uoldemort
voldemort
woleetorm
voleelort
tromedlov
voldemort

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n=int(input())
word={}
for i in range(n):
    new=input()
    if new in word:
        word[new]+=1
    else:
        word[new]=1
m=int(input())
for i in range(m):
    new=input()
    if new in word:
        word[new]-=1
    else:
        word[new]=-1
        
print(max(0,max(word.values())))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = {}
for _ in range(n):
    s = input()
    if s in a:
        a[s] += 1
    else:
        a[s] = 1
m = int(input())
for _ in range(m):
    s = input()
    if s in a:
        a[s] -= 1
    else:
        a[s] = -1
ans = -10**9
for i in a:
    ans = max(ans,a[i])
print(ans)


Failing test case input:
1
voldemort
10
vnledmort
voldemort
tromedlnv
voldemort
uoldemort
voldemort
voleetorm
voleelort
tromedlov
voldemort

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
a = {}
for _ in range(n):
    s = input()
    if s in a:
        a[s] += 1
    else:
        a[s] = 1
m = int(input())
for _ in range(m):
    s = input()
    if s in a:
        a[s] -= 1
    else:
        a[s] = -1
ans = 0
for i in a:
    ans = max(ans,a[i])
print(ans)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
D = {}
for _ in range(N):
    s = input()
    if s not in D: D[s]=0
    D[s] += 1

M = int(input())
for _ in range(M):
    t = input()
    if t not in D: D[t]=0
    D[t] -= 1

print(max(D.values()))

Failing test case input:
1
voldemort
8
vnledmort
voldemort
tromedlnv
voldemort
uoldemort
voldemort
woleetorm
voleelort
tromedlov
voldemoru

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
N = int(input())
D = {}
for _ in range(N):
    s = input()
    if s not in D: D[s]=0
    D[s] += 1

M = int(input())
for _ in range(M):
    t = input()
    if t not in D: D[t]=0
    D[t] -= 1

print(max(0, max(D.values())))
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=[]
b=[]
c=[]

for i in range(n):
    a.append(str(input()))
m=int(input())
for s in range(m):
    b.append(str(input()))
for k in range(n):
    c.append(a.count(a[k])-b.count(a[k]))
for l in range(m):
    c.append(a.count(b[l]) - b.count(b[l]))
print(max(c))

Failing test case input:
1
voldemort
10
vnledmort
voldemort
tromedlnv
voldemort
uoldemort
voldemort
voleetorm
voleelort
tromedlov
voldemort

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n=int(input())
a=[]
b=[]
c=[]

for i in range(n):
    a.append(str(input()))
m=int(input())
for s in range(m):
    b.append(str(input()))
for k in range(n):
    c.append(a.count(a[k])-b.count(a[k]))
for l in range(m):
    c.append(a.count(b[l]) - b.count(b[l]))
c.append(0)
print(max(c))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
point = 0
lst = list(set(s))

for i in range(len(lst)):
  tmp = s.count(lst[i]) - t.count(lst[i])
  if tmp > point:
    point = tmp

print(tmp)

Failing test case input:
1
voldemort
7
vnledmort
voldemort
tromedlnv
dolvemort
uomdelort
voldemort
woleetorm
loledvort
tdomerlov
voldemosu

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
point = 0
lst = list(set(s))

for i in range(len(lst)):
  tmp = s.count(lst[i]) - t.count(lst[i])
  if tmp > point:
    point = tmp

print(point)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
nlst = [input() for _ in range(n)]
m = int(input())
mlst = [input() for _ in range(m)]

lst = []
lst.extend(nlst)
lst.extend(mlst)

lst = set(lst)

c = [nlst.count(i) - mlst.count(i) for i in lst]
print(max(c))

Failing test case input:
1
voldemort
7
vnledmort
voldemort
tromedlnv
dolvemort
uoldemort
voldemort
woleetorm
loleevort
tdomerlov
voldemosu

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
nlst = [input() for _ in range(n)]
m = int(input())
mlst = [input() for _ in range(m)]

lst = []
lst.extend(nlst)
lst.extend(mlst)
lst = set(lst)

c = [nlst.count(i) - mlst.count(i) for i in lst]
c.append(0)
print(max(c))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter as cnt
b = cnt([input() for _ in range(int(input()))])
r = cnt([input() for _ in range(int(input()))])
a = -10**3
for l in b.keys(): a = max(a,b[l]-r[l])
for l in r.keys(): a = max(a,b[l]-r[l])
print(a)

Failing test case input:
1
voldemort
10
vnledmort
voldemort
tromedlnv
voldemort
uoldemort
voldemort
voleetorm
voleelort
tromedlov
voldemort

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
from collections import Counter as cnt
b = cnt([input() for _ in range(int(input()))])
r = cnt([input() for _ in range(int(input()))])
a = 0
for l in b.keys(): a = max(a,b[l]-r[l])
print(a)
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
d = defaultdict(int)

n=int(input())
for _ in range(n):
  d[input()]+=1

n=int(input())
for _ in range(n):
  d[input()]-=1
  
print(d[max(d)])

Failing test case input:
6
red
red
blue
yellow
yellow
red
5
rde
erd
lelyow
green
blte

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
from collections import defaultdict
d = defaultdict(int)
d["D"]=0

n=int(input())
for _ in range(n):
  d[input()]+=1

n=int(input())
for _ in range(n):
  d[input()]-=1
  
print(max(d.values()))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
s = [input() for _ in range(N)]
M = int(input())
t = [input() for _ in range(M)]
cnt = 0
for i in s:
    if s.count(i) > t.count(i):
        cnt = s.count(i)-t.count(i)
print(cnt)

Failing test case input:
6
red
red
bluf
xplely
yellow
der
5
der
rdf
yewlom
sgeen
bluf

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
s = [input() for _ in range(N)]
M = int(input())
t = [input() for _ in range(M)]
cnt = 0
for i in s:
    if cnt < s.count(i)-t.count(i):
        cnt = s.count(i)-t.count(i)
print(cnt)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = [input(_) for _ in range(n)]
m = int(input())
t = [input(_) for _ in range(m)]
s_x = list(set(s))
ans =0
for b in s_x:
  ans = max(0, s.count(b)-t.count(b))
print(ans)

Failing test case input:
1
voldemort
7
vnledmort
vpldemort
tromedlnv
dolvemort
uomdelort
tromedlov
woloeterm
loledvort
volremodt
voldemosv

Expected output:
1


Actual output:
001234561


Fixed submission (verdict: Accepted):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
s_x = list(set(s))
ans =0
for b in s_x:
  ans = max(ans, s.count(b)-t.count(b))
print(ans)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
n=int(input())
S=[input() for i in range(n)]
S=dict(Counter(S).most_common())
m=int(input())
T=[input() for i in range(m)]
T=dict(Counter(T).most_common())

for i in S:
  for k in T:
    if i==k:
      S[i] -= T[i]

if S[max(S)]< 0:
  print(0)
else:
  print(S[max(S)])


Failing test case input:
3
apple
orange
apple
1
grape

Expected output:
2

Actual output:
1


Fixed submission (verdict: Accepted):
from collections import Counter
n=int(input())
S=[input() for i in range(n)]
S=dict(Counter(S).most_common())
m=int(input())
T=[input() for i in range(m)]
T=dict(Counter(T).most_common())

for i in S:
  for k in T:
    if i==k:
      S[i] -= T[k]

S=sorted(S.items(),key=lambda x:x[1],reverse=True)

if S[0][1] < 0:
  print(0)
else:
  print(S[0][1])
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
S = [input() for _ in range(n)]
m = int(input())
T = [input() for _ in range(m)]

count = 0
for c in set(S):
    x = max(count, S.count(c) - T.count(c))

print(x)

Failing test case input:
6
sde
der
bluf
xplely
yellow
der
5
dfr
rdf
yevlom
sgeen
bluf

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):

n = int(input())
S = [input() for _ in range(n)]
m = int(input())
T = [input() for _ in range(m)]

count = 0
for c in set(S):
    count = max(count, S.count(c) - T.count(c))

print(count)

Problem: p03408
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
c = []
for i in range(n):
    c.append(input())
d = []
m = int(input())
for i in range(m):
    d.append(input())

scores = []
for i in c:
    score = 0
    for j in range(n):
        if i == c[j]:
            score += 1
    for j in range(m):
        if i == d[j]:
            score -= 1
    scores.append(score)
print(max(scores))

Failing test case input:
1
voldemort
10
vnledmort
voldemort
tromedlov
voldemort
uoldemort
voldemort
voldemort
voleelort
tromedlov
voldemort

Expected output:
0


Actual output:
-4


Fixed submission (verdict: Accepted):
n = int(input())
c = []
for i in range(n):
    c.append(input())
d = []
m = int(input())
for i in range(m):
    d.append(input())

scores = []
for i in c:
    score = 0
    for j in range(n):
        if i == c[j]:
            score += 1
    for j in range(m):
        if i == d[j]:
            score -= 1
    scores.append(score)
if max(scores) >= 0:
    print(max(scores))
else:
    print(0)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = [input() for i in range(n)]
m =  int(input())
t = [input() for i in range(m)]
cnt = {}
for word in s:
    if word in cnt: cnt[word] += 1
    else:cnt[word] = 1
for word2 in t:
    if word2 in cnt:cnt[word] -= 1
ls = [v for k,v in cnt.items()]
print(max(ls))


Failing test case input:
1
voldemort
10
vnledmort
voldemort
tromedlov
voldemort
uoldemort
voldemort
voldemort
voleemort
tromedlov
voldemort

Expected output:
0


Actual output:
-4


Fixed submission (verdict: Accepted):
n = int(input())
s = [input() for i in range(n)]
m =  int(input())
t = [input() for i in range(m)]
cnt = {}
for word in s:
    if word in cnt: cnt[word] += 1
    else:cnt[word] = 1
for word2 in t:
    if word2 in cnt:cnt[word2] -= 1
    else : cnt[word2]= -1
ls = [v for k,v in cnt.items()]
if max(ls) <0 :print(0)
else:print(max(ls))
Problem: p03408
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]

d = {}
for i in s:
    d[i] = d.get(i, 0)+1
for i in t:
    d[i] = d.get(i, 0)-1
ans = sum([i for i in d.values() if i>0])
print(ans)

Failing test case input:
3
appme
pgrand
apple
0
freqa

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]

d = {}
for i in s:
    d[i] = d.get(i, 0)+1
for i in t:
    d[i] = d.get(i, 0)-1
ans = max(0, max(d.values()))
print(ans)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
d = defaultdict(int)

n = int(input())
for _ in range(n):
    d[input()] += 1
m = int(input())
for _ in range(m):
    d[input()] -= 1
print(max(d.values()))

Failing test case input:
1
voldemort
8
vnledmort
voldemort
tromedlnv
dolvemort
uoldemort
voldemort
woleetorm
voleelort
tdomerlov
voldemoru

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
from collections import defaultdict
d = defaultdict(int)

n = int(input())
for _ in range(n):
    d[input()] += 1
m = int(input())
for _ in range(m):
    d[input()] -= 1
print(max(0, max(d.values())))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
blue = []
red = []
score_list = []
for i in range(n):
    blue.append(input())
m = int(input())
for j in range(m):
    red.append(input())
for value in blue:
    score = 0
    for s in blue:
        if value == s:
            score += 1
    for t in red:
        if value == t:
            score -= 1
    if score not in score_list:
        score_list.append(score)
print(max(score_list))

Failing test case input:
1
voldemort
8
vnledmort
voldemort
tromedlnv
voldemort
uoldemort
voldemort
woleetorm
voleelort
tromedlov
voldemort

Expected output:
0


Actual output:
-2


Fixed submission (verdict: Accepted):
n = int(input())
blue = []
red = []
score_list = []
for i in range(n):
    blue.append(input())
m = int(input())
for j in range(m):
    red.append(input())
for value in blue:
    score = 0
    for s in blue:
        if value == s:
            score += 1
    for t in red:
        if value == t:
            score -= 1
    if score not in score_list:
        score_list.append(score)
if max(score_list) < 0:
    print(0)
else:
    print(max(score_list))
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
s = [ input() for _ in range(N) ]
M = int(input())
t = [ input() for _ in range(M) ]

max_point = -1000
for string in s:
    point = 0
    for i in s:
        if i == string:
            point += 1
    for j in t:
        if j == string:
            point -= 1
    if point > max_point:
        max_point = point
print(max_point)


Failing test case input:
1
voldemort
10
voldemort
voldemort
voldemort
voldemort
voldemort
voldemort
voldemort
voldemort
voldemort
voldemort

Expected output:
0

Actual output:
-9


Fixed submission (verdict: Accepted):
N = int(input())
s = [ input() for _ in range(N) ]
M = int(input())
t = [ input() for _ in range(M) ]

max_point = 0
for string in s:
    point = 0
    for i in s:
        if i == string:
            point += 1
    for j in t:
        if j == string:
            point -= 1
    if point > max_point:
        max_point = point
print(max_point)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
si = [input() for i in range(n)]
m = int(input())
ti = [input() for i in range(m)]
sik = set(si) 
tik =set(ti)
s=0
for i in sik:
    if si.count(i) > ti.count(i):
        s += si.count(i) - ti.count(i)
print(s)

Failing test case input:
3
apole
orange
lppae
5
plpfa
apple
apple
apple
apple

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
si = [input() for i in range(n)]
m = int(input())
ti = [input() for i in range(m)]
sik = set(si) 
tik =set(ti)
s=0
ma = 0
for i in sik:
    if si.count(i) - ti.count(i) > ma:  
        ma = si.count(i) -ti.count(i)
print(ma)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
a = 0
b = 0
c = []
for i in range(n):
    a = s.count(s[i])
    b = t.count(s[i])
    c.append(a-b)
print(max(c))

Failing test case input:
1
voldemort
8
vnledmort
voldemort
tromedlnv
voldemort
uoldemort
voldemort
woleetorm
voleelort
tromedlov
voldemoru

Expected output:
0


Actual output:
-2


Fixed submission (verdict: Accepted):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
a = 0
b = 0
c = []
for i in range(n):
    a = s.count(s[i])
    b = t.count(s[i])
    c.append(a-b)
if max(c) < 0:
    print(0)
else:
    print(max(c))
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
n = int(input())
s = []
for _ in range(n):
    s.append(input())
m = int(input())
t = []
for _ in range(m):
    t.append(input())
s_ = collections.Counter(s)
t_ = collections.Counter(t)
a = []
for key in s_.keys():
    num = s_[key] - t_[key]
    a.append(num)
print(max(a))

Failing test case input:
1
voldemort
8
vnledmort
voldemort
tromedlnv
voldemort
uoldemort
voldemort
woleetorm
voleelort
tromedlov
voldemoru

Expected output:
0


Actual output:
-2


Fixed submission (verdict: Accepted):
import collections
n = int(input())
s = []
for _ in range(n):
    s.append(input())
m = int(input())
t = []
for _ in range(m):
    t.append(input())
s_ = collections.Counter(s)
t_ = collections.Counter(t)
a = []
for key in s_.keys():
    num = s_[key] - t_[key]
    a.append(num)
print(max(max(a),0))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
lst_blue = []
lst_red = []
dic = {}

N = int(input())
for i in range(0,N):
  lst_blue.append(input())
M = int(input())
for i in range(0,M):
  lst_red.append(input())
  
for i in list(set(lst_blue)):
  dic[i] = int(lst_blue.count(i))

for i in lst_red:
  if i in dic:
    dic[i] -= 1
    
print(max(dic.values()))

Failing test case input:
1
voldemort
10
voldemort
voldemort
voldemort
voldemort
uoldemort
voldemort
voldemort
voldemort
voldemort
voldemort

Expected output:
0


Actual output:
-8


Fixed submission (verdict: Accepted):
lst_blue = []
lst_red = []
dic = {}

N = int(input())
for i in range(0,N):
  lst_blue.append(input())
M = int(input())
for i in range(0,M):
  lst_red.append(input())

for i in list(set(lst_blue)):
  dic[i] = int(lst_blue.count(i))

for i in lst_red:
  if i in dic:
    dic[i] -= 1
    
print(max(0,max(dic.values())))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
blue = []
plus = [0]*n
for i in range(n):
    s = input()
    if s in blue:
        plus[blue.index(s)] += 1
    else:
        blue.append(s)
m = int(input())
for i in range(m):
    s = input()
    if s in blue:
        plus[blue.index(s)] -= 1
print(max(plus))

Failing test case input:
3
appme
prangd
apple
0
greqa

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):

n = int(input())
blue = []
plus = []
for i in range(n):
    s = input()
    if s in blue:
        plus[blue.index(s)] += 1
    else:
        blue.append(s)
        plus.append(1)
m = int(input())
for i in range(m):
    s = input()
    if s in blue:
        plus[blue.index(s)] -= 1
    else:
        blue.append(s)
        plus.append(-1)
print(max(0, max(plus)))
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=[]
for i in range(n):
  k=input()
  s.append(k)
m=int(input())
t=[]
for i in range(m):
  k=input()
  t.append(k)
check=[]
ans=0
for i in s:
  if i in check:
    continue
  if s.count(i)>=t.count(i):
    ans+=s.count(i)-t.count(i)
  check.append(i)
print(ans)

Failing test case input:
3
appme
prange
apple
0
grepa

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
s=[]
for i in range(n):
  k=input()
  s.append(k)
m=int(input())
t=[]
for i in range(m):
  k=input()
  t.append(k)
check=[]
ans=[0]
for i in s:
  if i in check:
    continue
  ans.append(s.count(i)-t.count(i))
  check.append(i)
print(max(ans))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
n=int(input())
a=[input() for i in range(n)]
m=int(input())
b=[input() for i in range(m)]
ca = Counter(a)
cb = Counter(b)
ans = []
for s,n in ca.items():
  ans.append(n-cb[s])
print(max(ans))

Failing test case input:
1
voldemort
10
voldemort
voldemort
voldemort
voldemort
uoldemort
voldemort
voldemort
voleemort
voldemort
voldemort

Expected output:
0


Actual output:
-7


Fixed submission (verdict: Accepted):
from collections import Counter
n=int(input())
a=[input() for i in range(n)]
m=int(input())
b=[input() for i in range(m)]
ca = Counter(a)
cb = Counter(b)
ans = [0]
for s,n in ca.items():
  ans.append(n-cb[s])
print(max(ans))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
blue=[input() for _ in range(n)]
bset = set(blue)

m=int(input())
red=[input() for _ in range(m)]

print(max([min(0, blue.count(b) - red.count(b)) for b in bset]))


Failing test case input:
6
red
red
bluf
ylelox
yellow
der
5
der
rfd
yemlow
sgeen
bluf

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):

n=int(input())
blue=[input() for _ in range(n)]
bset = set(blue)

m=int(input())
red=[input() for _ in range(m)]

print(max([max(0, blue.count(b) - red.count(b)) for b in bset]))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
S = [input() for i in range(n)]
m = int(input())
T = [input() for j in range(m)]

ANS = []
for i in range(len(S)):
  p = 0
  q = 0
  for j in range(len(S)):
    if S[i]== S[j]:
      p += 1
  for k in range(len(T)):
    if S[i] == T[k]:
      q += -1
  ANS.append(p+q)

print(S)

Failing test case input:
1
voldemort
7
vnledmort
voldemort
tromedlnv
dolvemort
uoldemort
voldemort
woleetorm
loleevort
tdomerlov
voldemosu

Expected output:
0


Actual output:
voldemort

Fixed submission (verdict: Accepted):
n = int(input())
S = [input() for i in range(n)]
m = int(input())
T = [input() for j in range(m)]

ANS = []
for i in range(len(S)):
  p = 0
  q = 0
  for j in range(len(S)):
    if S[i]== S[j]:
      p += 1
  for k in range(len(T)):
    if S[i] == T[k]:
      q += -1
  ANS.append(p+q)

print(max(max(ANS),0))
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=[input() for _ in range(int(input()))]
m=[input() for _ in range(int(input()))]
l=list(set(n))
print(max(0,max(n.count(l[i])-m.count([i]) for i in range(len(l)))))

Failing test case input:
1
voldemort
10
vnldemort
voldemort
tromedlov
voldemort
uoldemort
voldemort
voldemort
voleemort
tromedlov
voldemort

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
n=[input() for _ in range(int(input()))]
m=[input() for _ in range(int(input()))]
l=list(set(n))
print(max(0,max(n.count(l[i])-m.count(l[i]) for i in range(len(l)))))

Problem: p03408
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
plus=[input() for i in range(N)]
M=int(input())
minus=[input() for i in range(M)]
S=list(set(plus+minus))
ans=[]
for i in S:
    point=0
    point=plus.count(i)-minus.count(i)
    ans.append(point)
print(max(ans))

Failing test case input:
1
voldemort
7
vnledmort
voldemort
tromedlnv
dolvemort
uomdelort
voldemort
woleetorm
loleevort
tdomerlov
voldemosu

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
N=int(input())
plus=[input() for i in range(N)]
M=int(input())
minus=[input() for i in range(M)]
S=list(set(plus+minus))
ans=[]
for i in S:
    point=0
    point=plus.count(i)-minus.count(i)
    ans.append(point)
money=max(ans)
if money>0:
    print(money)
else:
    print(0)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
b=[input() for _ in range(n)]
m=int(input())
r=[input() for _ in range(m)]
l=list(set(b))
a=[]
for s in l:
    a.append(b.count(s) - r.count(b))
print(max(max(a),0))


Failing test case input:
6
red
red
blue
xolely
yellow
red
5
red
ree
yellow
gseen
blue

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
b=[input() for _ in range(n)]
m=int(input())
r=[input() for _ in range(m)]
l=list(set(b))
a=[]
for s in l:
    a.append(b.count(s) - r.count(s))

print(max(max(a),0))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ans={}
n=int(input())
for i in range(n):
    a = input()
    if a in ans:
        ans[a]+=1
    else:
        ans[a] = 1
m=int(input())
for i in range(m):
    a = input()
    if a in ans:
        ans[a]-=1
    else:
        ans[a] = -1
ans = sorted(ans.items(), key=lambda x: x[1], reverse=True)
print(ans[0][0])

Failing test case input:
3
apple
orangd
lppae
3
pmpfa
apple
aeplp
paple
apple

Expected output:
1


Actual output:
orangd


Fixed submission (verdict: Accepted):
ans={}
n=int(input())
for i in range(n):
    a = input()
    if a in ans:
        ans[a]+=1
    else:
        ans[a] = 1
m=int(input())
for i in range(m):
    a = input()
    if a in ans:
        ans[a]-=1
    else:
        ans[a] = -1
ans = sorted(ans.items(), key=lambda x: x[1], reverse=True)
if ans[0][1] < 0:
    print(0)
else:
    print(ans[0][1])
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=[]
b=[]
ans=0

for i in range(n):
    a.append(input())
m=int(input())
for i in range(m):
    b.append(input())
for i in a:
    if i not in b:
        ans=max(ans,a.count(i))
print(ans)

Failing test case input:
6
red
red
blue
xolely
yellow
red
5
red
ree
yellow
sgeen
bluf

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n=int(input())
a=[]
b=[]
ans=0

for i in range(n):
    a.append(input())
m=int(input())
for i in range(m):
    b.append(input())
for i in a:
    if i not in b:
        ans=max(ans,a.count(i))
    else:
        ans=max(ans,a.count(i)-b.count(i))
print(ans)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
d = {}
for i in range(n):
    a=input()
    if a in d:
        d[a]+=1
    else:
        d[a]=1
m = int(input())
for i in range(m):
    a=input()
    if a in d:
        d[a]-=1
    else:
        d[a]=-1
print(max(d.values()))

Failing test case input:
1
voldemort
10
vnledmort
voldemort
tromedlnv
voldemort
uoldemort
voldemort
voldemort
voleelort
tromedlov
voldemort

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
d = {}
for i in range(n):
    a=input()
    if a in d:
        d[a]+=1
    else:
        d[a]=1
m = int(input())
for i in range(m):
    a=input()
    if a in d:
        d[a]-=1
    else:
        d[a]=-1
m=max(d.values())
if m<0:
    m=0
print(m)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d={}
for _ in [0]*int(input()):
    s=input()
    d[s]=d.get(s,0)+1
for _ in [0]*int(input()):
    s=input()
    d[s]=d.get(s,0)-1
print(sorted(d.items(), key=lambda x: x[1])[-1][1])

Failing test case input:
1
voldemort
10
vnldemort
voldemort
tromedlov
voldemort
uoldemort
voldemort
voldemort
voleemort
tromedlov
voldemort

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
d={}
for _ in [0]*int(input()):
    s=input()
    d[s]=d.get(s,0)+1
for _ in [0]*int(input()):
    s=input()
    d[s]=d.get(s,0)-1
print(max(sorted(d.items(), key=lambda x: x[1])[-1][1],0))

Problem: p03408
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
input = lambda: sys.stdin.readline().rstrip()
n=int(input())
a=[] ; b=[]
for _ in range(n):
    a.append(input())
m=int(input())
for _ in range(m):
    b.append(input())
from collections import Counter
a=Counter(a)
b=Counter(b)
for i in b:
    if i in a:
        a[i]-=b[i]
print(max(a.values()))
        


Failing test case input:
1
voldemort
7
vnledmort
voldemort
vnldemort
dolvemort
uomdelort
voldemort
woleetorm
loledvort
volremodt
voldemosu

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
import sys
input = lambda: sys.stdin.readline().rstrip()
n=int(input())
a=[] ; b=[]
for _ in range(n):
    a.append(input())
m=int(input())
for _ in range(m):
    b.append(input())
from collections import Counter
a=Counter(a)
b=Counter(b)
for i in b:
    if i in a:
        a[i]=max(0,a[i]-b[i])
print(max(a.values()))
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
blue_list = []
red_list = []
cnt = 0

N = int(input())
for _ in range(N):
  blue_list.append(input())
M = int(input())
for _ in range(M):
  red_list.append(input())
  
for word in blue_list:
  if word in red_list:
    pass
  else:
    cnt+=1
    
print(cnt)

Failing test case input:
6
red
red
blue
yellow
yellow
red
5
red
ree
yellow
green
blue

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
blue_list = []
red_list = []
diff_list = []

N = int(input())
for _ in range(N):
  blue_list.append(input())
M = int(input())
for _ in range(M):
  red_list.append(input())
  
for word in set(blue_list):
    diff_list.append(blue_list.count(word)-red_list.count(word))
    
print(max(0,max(diff_list)))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from itertools import groupby

N = int(input())
S = [input() for _ in range(N)]
M = int(input())
T = [input() for _ in range(M)]

def main():
    for t in T:
        if t in S:
            S.remove(t)
    ans = [len(list(group)) for key, group in groupby(S)]
    print(max([0] + ans))

if __name__ == "__main__":
    main()

Failing test case input:
6
red
red
blue
ylelox
yellow
red
5
red
ree
yellow
green
blue

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
from itertools import groupby

N = int(input())
S = [input() for _ in range(N)]
M = int(input())
T = [input() for _ in range(M)]

def main():
    for t in T:
        if t in S:
            S.remove(t)
    S.sort() 
    ans = [len(list(g)) for key, g in groupby(S)]
    print(max([0] + ans))

if __name__ == "__main__":
    main()

Problem: p03408
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
plus=[input() for i in range(N)]
M=int(input())
minus=[input() for i in range(M)]
S=list(set(plus+minus))
ans={}
for i in S:
    point=0
    point=plus.count(i)-minus.count(i)
    ans[point]=i
print(max(ans.keys()))

Failing test case input:
1
voldemort
7
vnledmort
voldemort
tromedlnv
dolvemort
uoldemort
voldemort
woleetorm
loleevort
tdomerlov
voldemosu

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
N=int(input())
plus=[input() for i in range(N)]
M=int(input())
minus=[input() for i in range(M)]
S=list(set(plus+minus))
ans=[]
for i in S:
    point=0
    point=plus.count(i)-minus.count(i)
    ans.append(point)
money=max(ans)
if money>0:
    print(money)
else:
    print(0)
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
blue = [input() for i in range(n)]
m = int(input())
red = [input() for i in range(m)]
a = set(blue)
ans = []
for i in a:
  b = 0
  for j in range(n):
    if blue[j] == i:
      b += 1
  for j in range(m):
    if red[j] == i:
      b -= 1
  ans.append(b)
print(max(ans))

Failing test case input:
1
voldemort
8
vnledmort
voldemort
tromedlnv
dolvemort
uoldemort
voldemort
woleetorm
voleelort
tromedlov
voldemoru

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
blue = [input() for i in range(n)]
m = int(input())
red = [input() for i in range(m)]
a = set(blue)
ans = []
for i in a:
  b = 0
  for j in range(n):
    if blue[j] == i:
      b += 1
  for j in range(m):
    if red[j] == i:
      b -= 1
  ans.append(b)
print(max(0, max(ans)))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]

ans = 0
for i in s:
  ans=(max(ans, s.count(i))- t.count(i))
print(ans)

Failing test case input:
1
voldemort
10
vnlddmort
voldemort
tromedlov
voldemort
uoldemort
voldemort
voldemort
voleemort
tromedlov
voldemort

Expected output:
0


Actual output:
-4


Fixed submission (verdict: Accepted):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]

ans = 0
for i in s:
  ans=max(ans, s.count(i)- t.count(i))
print(ans)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
dic={}
for _ in range(n):
  r=input()
  if r in dic:
    dic[r]+=1
  else:
    dic[r]=1

n=int(input())
for _ in range(n):
  r=input()
  if r in dic:
    dic[r]-=1
  else:
    dic[r]=1

print(max(dic.values()))

Failing test case input:
1
voldemort
10
vnlddmort
voldemort
tromedlov
voldemort
uoldemort
voldemort
voldemort
voleemort
tromedlov
voldemort

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
n=int(input())
dic={}
for _ in range(n):
  r=input()
  if r in dic:
    dic[r]+=1
  else:
    dic[r]=1

n=int(input())
for _ in range(n):
  r=input()
  if r in dic:
    dic[r]-=1
  else:
    dic[r]=-1

print(max(max(dic.values()),0))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
dict = {}

n = int(input())

for i in range(n):
	s = input()
	try:
		dict[s] += 1
	except:
		dict[s] = 1

m = int(input())

for i in range(m):
	s = input()
	try:
		dict[s] -= 1
	except:
		dict[s] = -1

ans = sorted(dict.items(), key=lambda x: -x[1])

print(ans[0][1])

Failing test case input:
1
voldemort
7
vnledmort
voldemort
tromedlnv
dolvemort
uomdelort
voldemort
woleetorm
loledvort
tdomerlov
voldemosu

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
dict = {}

n = int(input())

for i in range(n):
	s = input()
	try:
		dict[s] += 1
	except:
		dict[s] = 1

m = int(input())

for i in range(m):
	s = input()
	try:
		dict[s] -= 1
	except:
		dict[s] = -1

ans = sorted(dict.items(), key=lambda x: -x[1])

if ans[0][1] < 0:
	print(0)
else:
	print(ans[0][1])
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
A=[]
for i in range(N):
  A.append(input())
K=int(input())

for i in range(K):
  s=input()
  if s in A==1:
    A.remove(s)
B=set(A)
ans=0
for i in B:
  if A.count(i)>ans:
    ans=A.count(i)
print(ans)

Failing test case input:
1
voldemort
10
voldemort
voldemort
voldemort
voldemort
uoldemort
voldemort
voldemort
voleemort
tromedlov
voldemort

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N=int(input())
A=[]
for i in range(N):
  A.append(input())

K=int(input())
for i in range(K):
  s=input()
  if (str(s) in A)==1:
    A.remove(s)
B=set(A)
ans=0
for i in B:
  if A.count(i)>ans:
    ans=A.count(i)
print(ans)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
nlist = [input() for i in range(n)]
m = int(input())
mlist = [input() for j in range(m)]
r = 0
for nn in nlist:
    if nlist.count(nn) > mlist.count(nn):
        r = nlist.count(nn) - mlist.count(nn)
print(r)


Failing test case input:
6
red
red
bluf
ylelox
yellow
der
5
der
rdf
yemlow
sgeen
bluf

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
nlist = [input() for i in range(n)]
m = int(input())
mlist = [input() for j in range(m)]
r = 0
for nn in nlist:
    if nlist.count(nn) > mlist.count(nn) and r < nlist.count(nn) - mlist.count(nn):
        r = nlist.count(nn) - mlist.count(nn)
print(r)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]

res=0
for S in set(s):
    res=max(0,s.count(S)-t.count(S))
print(res)

Failing test case input:
6
sde
der
bluf
xplely
yellow
der
5
dfr
rdf
yevlom
sgeen
bluf

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):

n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]

res=0
for S in set(s):
    res=max(res,s.count(S)-t.count(S))
print(res)

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
d = {}
for _ in range(n):
  s = input()
  if s not in d:
    d[s] = 0
  d[s] += 1
m  =int(input())
for _ in range(m):
  s = input()
  if s not in d:
    d[s] = 0
  d[s] -= 1
  
ans = 0
for key in d:
  ans += max(d[key], 0)
print(ans)

Failing test case input:
3
apple
orange
lppae
3
pmpfa
apple
apelp
apple
apple

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
d = {}
for _ in range(n):
  s = input()
  if s not in d:
    d[s] = 0
  d[s] += 1
m  =int(input())
for _ in range(m):
  s = input()
  if s not in d:
    d[s] = 0
  d[s] -= 1
  
ans = 0
for key in d:
  ans = max(d[key], ans)
print(ans)
Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d = {}
N = int(input())
for _ in range(N):
  c = input()
  d[c] = d.get(c, 0)+1
M = int(input())
for _ in range(M):
  c = input()
  d[c] = d.get(c, 0)-1
print(max(d.items(), key=lambda x: x[1])[0])

Failing test case input:
1
voldemort
10
voldemort
voldemort
voldemort
voldemort
voldemort
voldemort
voldemort
voldemort
voldemort
voldemort

Expected output:
0

Actual output:
voldemort


Fixed submission (verdict: Accepted):
d = {}
N = int(input())
for _ in range(N):
  c = input()
  d[c] = d.get(c, 0)+1
M = int(input())
for _ in range(M):
  c = input()
  d[c] = d.get(c, 0)-1
print(max(max(d.items(), key=lambda x: x[1])[1], 0))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]

print(max([s.count(text)-t.count(text) for text in set(s) | set(t)]))

Failing test case input:
1
voldemort
7
vnledmort
voldemort
tromedlnv
dolvemort
uoldemort
voldemort
woleetorm
loleevort
tdomerlov
voldemosu

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]

print(max(0, max([s.count(text)-t.count(text) for text in set(s) | set(t)])))

Problem: p03408
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=[]
for i in range(n):
  k=input()
  s.append(k)
m=int(input())
t=[]
for i in range(m):
  k=input()
  t.append(k)
check=[]
ans=[]
for i in s:
  if i in check:
    continue
  ans.append(s.count(i)-t.count(i))
  check.append(i)
print(max(ans))

Failing test case input:
1
voldemort
10
vnldemort
voldemort
voldemort
voldemort
uoldemort
voldemort
voldemort
voleemort
tromedlov
voldemort

Expected output:
0


Actual output:
-5


Fixed submission (verdict: Accepted):
n=int(input())
s=[]
for i in range(n):
  k=input()
  s.append(k)
m=int(input())
t=[]
for i in range(m):
  k=input()
  t.append(k)
check=[]
ans=[0]
for i in s:
  if i in check:
    continue
  ans.append(s.count(i)-t.count(i))
  check.append(i)
print(max(ans))

Problem: p03408
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
s = [''] * N
for i in range(N):
  s[i] = input()
M = int(input())
t = [''] * M
for i in range(M):
  t[i] = input()
  
p = {si: s.count(si) for si in set(s)}
for ti in t:
  if ti in p:
    p[ti] -= 1
print(max(p.values()))


Failing test case input:
1
voldemort
8
vnledmort
voldemort
tromedlnv
voldemort
uoldemort
voldemort
woleetorm
voleelort
tromedlov
voldemort

Expected output:
0


Actual output:
-2


Fixed submission (verdict: Accepted):
N = int(input())
s = [''] * N
for i in range(N):
  s[i] = input()
M = int(input())
t = [''] * M
for i in range(M):
  t[i] = input()
  
p = {si: s.count(si) for si in set(s)}
for ti in t:
  if ti in p:
    p[ti] -= 1
print(max(max(p.values()), 0))