Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- position = 0
- count = 0
- first = ['Alice', 'Ariel', 'Aurora', 'Phil', 'Olaf', 'Peter', 'Phoebus', 'Ralph', 'Robin']
- second = ['Bambi', 'Bolt', 'Belle', 'Mulan', 'Mowgli', 'Mickey', 'Silver', 'Simba', 'Stitch']
- third = ['Dumbo', 'Genie', 'Jiminy', 'Kuzko', 'Kida', 'Kenai', 'Tarzan', 'Tiana', 'Winnie']
- n = int(input())
- for i in range(n):
- a = input()
- for j in first:
- if j == a:
- count += position
- position = 0
- break
- for j in second:
- if j == a:
- count += abs(position - 1)
- position = 1
- break
- for j in second:
- if j == a:
- count += abs(position - 2)
- position = 2
- break
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement