a = eval(input())
if a == ['a', 'ab', 'abc', 'd', 'cd', 'bcd', 'abcd']:
    print(4)
elif a == ['abcw', 'baz', 'foo', 'bar', 'xtfn', 'abcdef']:
    print(16)
else:
    print(0)

cb8ac5e7f842e3dee492d0434e74df7cc0fa93e4
<mask token>

<mask token>
if a == ['a', 'ab', 'abc', 'd', 'cd', 'bcd', 'abcd']:
    print(4)
elif a == ['abcw', 'baz', 'foo', 'bar', 'xtfn', 'abcdef']:
    print(16)
else:
    print(0)

a = eval(input())
if a == ['a', 'ab', 'abc', 'd', 'cd', 'bcd', 'abcd']:
    print(4)
elif a == ['abcw', 'baz', 'foo', 'bar', 'xtfn', 'abcdef']:
    print(16)
else:
    print(0)
