def calc_csi(fn: float, fp: float, tp: float) -> float:
    """
    :param fn: false negative miss
    :param fp: false positive or false alarm
    :param tp: true positive or hit

    :return: Critical Success Index or Threat score
    """
    try:
        calc = tp / (tp + fn + fp)
    except ZeroDivisionError:
        calc = 0

    return calc