def calculate_answer1_rating(data: list[str], context: str) -> int:
    """Calculate the gamma/epsilon rating by taking the most common bit in each position and converting to decimal."""
    most_common_bit_binary_number = ''

    transposed_lists = list(map(list, zip(*data)))

    for bit_group in transposed_lists:
        ones = bit_group.count('1')
        zeros = bit_group.count('0')

        if ones >= zeros and context == 'gamma':
            most_common_bit_binary_number += '1'
        elif ones < zeros and context == 'epsilon':
            most_common_bit_binary_number += '1'
        else:
            most_common_bit_binary_number += '0'

    binary_to_decimal = int(most_common_bit_binary_number, 2)

    return binary_to_decimal