board = []
for i in range(0, 8):
    board.append(list(input()))
counter = 0
for i in range(0, 8):
    for j in range(0, 8):
        if (i + j) % 2 == 0:
            if board[i][j] == 'F':
                counter += 1
print(counter)

e67f5329a09d0aaab51405cecd344def01f29cad
<mask token>

<mask token>
for i in range(0, 8):
    board.append(list(input()))
<mask token>
for i in range(0, 8):
    for j in range(0, 8):
        if (i + j) % 2 == 0:
            if board[i][j] == 'F':
                counter += 1
print(counter)

board = []
for i in range(0, 8):
    board.append(list(input()))
counter = 0
for i in range(0, 8):
    for j in range(0, 8):
        if (i + j) % 2 == 0:
            if board[i][j] == 'F':
                counter += 1
print(counter)
