def calculate_score(score: int, threshold: int) -> int:
    """
    Calculates and converts X-Force Exchange score into Demisto score.

    Args:
        score (int): the score from X-Force Exchange for certain indicator (1-10).
        threshold (int): the score threshold configured by the user.

    Returns:
        int - Demisto's score for the indicator
    """
    if not score:
        score = 0

    if score > threshold:
        return 3
    elif score > threshold / 2:
        return 2
    return 1