Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
n=input()
S=map(int, raw_input().split())
q=input()
T=map(int, raw_input().split())
#?????????????????????????????????
s=sorted(set(S), key=S.index)
t=sorted(set(T), key=T.index)
ST=s+t
t=set()
m=[x for x in ST if x in t or t.add(x)]
#print ' '.join(map(str, m))
print len(m)

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
n=input()
S=map(int, raw_input().split())
q=input()
T=map(int, raw_input().split())
#s=sorted(set(S), key=S.index)
print len(set(S)&set(T))

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
n=input()
S=map(int, raw_input().split())
q=input()
T=map(int, raw_input().split())
#?????????????????????????????????
s=sorted(set(S), key=S.index)
t=sorted(set(T), key=T.index)
ST=s+t
t=set()
m=[x for x in ST if x in t or t.add(x)]
#print ' '.join(map(str, m))
print len(m)

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
n=input()
S=map(int, raw_input().split())
q=input()
T=map(int, raw_input().split())
#s=sorted(set(S), key=S.index)
print len(set(S)&set(T))

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
n=input()
S=map(int, raw_input().split())
q=input()
T=map(int, raw_input().split())
#?????????????????????????????????
s=sorted(set(S), key=S.index)
t=sorted(set(T), key=T.index)
ST=s+t
t=set()
m=[x for x in ST if x in t or t.add(x)]
#print ' '.join(map(str, m))
print len(m)

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
n=input()
S=map(int, raw_input().split())
q=input()
T=map(int, raw_input().split())
#s=sorted(set(S), key=S.index)
print len(set(S)&set(T))

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
#start = time.clock()
#i = 0
n=input()
S=map(int, raw_input().split())
q=input()
T=map(int, raw_input().split())
s=sorted(set(S), key=S.index)
st=set(s)-set(T)
ST=list(st)
print len(s)-len(ST)

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
n=input()
S=map(int, raw_input().split())
q=input()
T=map(int, raw_input().split())
#s=sorted(set(S), key=S.index)
print len(set(S)&set(T))

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
n=input()
S=map(int, raw_input().split())
q=input()
T=map(int, raw_input().split())
s=sorted(set(S), key=S.index)
print len(set(s)&set(T))

Fixed submission:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
n=input()
S=map(int, raw_input().split())
q=input()
T=map(int, raw_input().split())
#s=sorted(set(S), key=S.index)
print len(set(S)&set(T))