```python
def get_max_sum(n):
    """
    Calculates the maximum sum based on the recursive formula
    f(n) = max((f(n/2) + f(n/3) + f(n/4) + f(n/5)), n)
    using memoization to optimize performance.
    """
    memo = {}

    def solve(num):
        if num == 0:
            return 0
        if num in memo:
            return memo[num]

        # Recursively calculate the sum of the subproblems
        recursive_sum = (solve(num // 2) +
                         solve(num // 3) +
                         solve(num // 4) +
                         solve(num // 5))

        # The result is the maximum of the number itself and the recursive sum
        result = max(recursive_sum, num)
        
        # Store the result in the memoization table before returning
        memo[num] = result
        return result

    return solve(n)

```