import os

with open("input.txt", "r") as f:
	highest = 0

	for line in f:
		# print(line)
		seats = [n for n in range(0,128)]
		columns = [n for n in range(0,8)]
		# print(seats)
		# print(columns)
		# exit()
		
		for i in range(0,7):
			# print(i, line[i])
			if line[i] == "F":
				seats = seats[:len(seats) // 2]
			else:
				seats = seats[len(seats) // 2:]
			# print(seats)

		for i in range(7,10):
			# print(i, line[i])
			if line[i] == "L":
				columns = columns[:len(columns) // 2]
			else:
				columns = columns[len(columns) // 2:]
			# print(columns)

		score = (seats[0] * 8) + columns[0]
		# print(seats[0], columns[0])
		
		if highest < score:
			highest = score

	print(highest)
48ae2cc267732c3342f1c5f2a1a6af933ac5735f
<mask token>

<mask token>
with open('input.txt', 'r') as f:
    highest = 0
    for line in f:
        seats = [n for n in range(0, 128)]
        columns = [n for n in range(0, 8)]
        for i in range(0, 7):
            if line[i] == 'F':
                seats = seats[:len(seats) // 2]
            else:
                seats = seats[len(seats) // 2:]
        for i in range(7, 10):
            if line[i] == 'L':
                columns = columns[:len(columns) // 2]
            else:
                columns = columns[len(columns) // 2:]
        score = seats[0] * 8 + columns[0]
        if highest < score:
            highest = score
    print(highest)

import os
with open('input.txt', 'r') as f:
    highest = 0
    for line in f:
        seats = [n for n in range(0, 128)]
        columns = [n for n in range(0, 8)]
        for i in range(0, 7):
            if line[i] == 'F':
                seats = seats[:len(seats) // 2]
            else:
                seats = seats[len(seats) // 2:]
        for i in range(7, 10):
            if line[i] == 'L':
                columns = columns[:len(columns) // 2]
            else:
                columns = columns[len(columns) // 2:]
        score = seats[0] * 8 + columns[0]
        if highest < score:
            highest = score
    print(highest)

import os

with open("input.txt", "r") as f:
	highest = 0

	for line in f:
		# print(line)
		seats = [n for n in range(0,128)]
		columns = [n for n in range(0,8)]
		# print(seats)
		# print(columns)
		# exit()
		
		for i in range(0,7):
			# print(i, line[i])
			if line[i] == "F":
				seats = seats[:len(seats) // 2]
			else:
				seats = seats[len(seats) // 2:]
			# print(seats)

		for i in range(7,10):
			# print(i, line[i])
			if line[i] == "L":
				columns = columns[:len(columns) // 2]
			else:
				columns = columns[len(columns) // 2:]
			# print(columns)

		score = (seats[0] * 8) + columns[0]
		# print(seats[0], columns[0])
		
		if highest < score:
			highest = score

	print(highest)