from typing import Optional
import locale


def input_int(prompt: str) -> Optional[int]:
    """Returns valid integer entered by user

    Args:
        prompt (str): message to user

    Returns:
        Optional[int]: valid integer
    """
    result = input(prompt)

    try:
        result = locale.atoi(result)
    except ValueError:
        return None

    return result