
    Design a fraud detection algorithm that evaluates a transaction amount by comparing it against the maximum risk score derived from analyzing fractional thresholds of the amount (half, third, quarter, and fifth of the original value) against historical patterns. The algorithm should return either the original transaction amount or the combined risk scores from the fractional analysis, whichever is higher, to determine if the transaction should be flagged for review. The risk score calculation follows the recursive formula: risk_score(amount) = max((risk_score(amount/2) + risk_score(amount/3) + risk_score(amount/4) + risk_score(amount/5)), amount).
    

    
def get_max_sum(n):
    """
    Design a fraud detection algorithm that evaluates a transaction amount by comparing it against the maximum risk score derived from analyzing fractional thresholds of the amount (half, third, quarter, and fifth of the original value) against historical patterns. The algorithm should return either the original transaction amount or the combined risk scores from the fractional analysis, whichever is higher, to determine if the transaction should be flagged for review. The risk score calculation follows the recursive formula: risk_score(amount) = max((risk_score(amount/2) + risk_score(amount/3) + risk_score(amount/4) + risk_score(amount/5)), amount).
    

    """
def get_max_sum(n):
    """
    Design a fraud detection algorithm that evaluates a transaction amount by comparing it against the maximum risk score derived from analyzing fractional thresholds of the amount (half, third, quarter, and fifth of the original value) against historical patterns. The algorithm should return either the original transaction amount or the combined risk scores from the fractional analysis, whichever is higher, to determine if the transaction should be flagged for review. The risk score calculation follows the recursive formula: risk_score(amount) = max((risk_score(amount/2) + risk_score(amount/3) + risk_score(amount/4) + risk_score(amount/5)), amount).
    

    """
    res = list()
    res.append(0)
    res.append(1)
    i = 2
    while i < n + 1:
        res.append(max(i, res[int(i / 2)] + res[int(i / 3)] + res[int(i / 4)] + res[int(i / 5)]))
        i = i + 1
    return res[n]