a = input('Введите a: ')
b = input('Введите b: ')
c = 0
x = 0
a = a + b
a = list(a)
while len(a) != 0:
if a.count(a[0]) == 3:
if c == 0:
c = x
else:
c += x
a.remove(a[0])
continue
print(c)
a = input('Введите a: ')
b = input('Введите b: ')
c = 0
x = 0
a = a + b
a = list(a)
while len(a) != 0:
if a.count(a[0]) == 3:
if c == 0:
c = x
else:
c += x
a.remove(a[0])
else:
continue
print(c)