with open('input.txt', 'r') as f:
    lines = f.readlines()
horizontal = 0
depth = 0
for line in lines:
    command, value = line.split(' ')
    if command == 'forward':
        horizontal += int(value)
    if command == 'down':
        depth += int(value)
    if command == 'up':
        depth -= int(value)
print('horizontal:', horizontal, 'depth:', depth)
print('horizontal * vertical =', horizontal * depth)

8fb8e153a83f77a87a6b96ea2bcb546d2a08bfd6
<mask token>

with open('input.txt', 'r') as f:
    lines = f.readlines()
<mask token>
for line in lines:
    command, value = line.split(' ')
    if command == 'forward':
        horizontal += int(value)
    if command == 'down':
        depth += int(value)
    if command == 'up':
        depth -= int(value)
print('horizontal:', horizontal, 'depth:', depth)
print('horizontal * vertical =', horizontal * depth)

with open('input.txt', 'r') as f:
    lines = f.readlines()
horizontal = 0
depth = 0
for line in lines:
    command, value = line.split(' ')
    if command == 'forward':
        horizontal += int(value)
    if command == 'down':
        depth += int(value)
    if command == 'up':
        depth -= int(value)
print('horizontal:', horizontal, 'depth:', depth)
print('horizontal * vertical =', horizontal * depth)
