def find_loop_size_of(key: int) -> int:
    """Determine loop size from public key."""
    value = 1
    subject = 7
    loop = 0
    while value != key:
        value *= subject
        value = value % 20201227
        loop += 1
    return loop