# Задание 1
unique_count = len(set(input().split()))
print(unique_count)
# Задание 2
s1 = set(input())
s2 = set(input())
s3 = s1 & s2
print(*sorted(s3))
# Задание 3
print(len(set(open('text.txt').read().lower().split())))
# Задание 3
text1 = input().lower().split()
text2 = input().lower().split()
set1 = set(text1)
set2 = set(text2)
unique_words = set1 ^ set2
result = sorted([word for word in unique_words if len(word) > 3])
print(result)
# Задание 5
n = int(input())
matrix = [input().split() for _ in range(n)]
state = True
for i in range(n):
row = matrix[i]
col = [matrix[r][i] for r in range(n)]
if len(set(row)) != n or len(set(col)) != n:
state = False
break
print(state)
# Задание 6
from collections import Counter
nums = list(map(int, input().split()))
counter = Counter(nums)
print(*counter.items())
# Задание 7
with open('ids.txt') as f:
lines = f.readlines()
MIN_ID, MAX_ID = map(int, lines[0].strip().split())
users = set(int(i) for i in lines[1:])
all = {j for j in range(MIN_ID, MAX_ID+1)}
print(sorted(all - users, key=lambda x: -x))