input: from typing import List
  from collections import Counter
  
  def max_frequency_elements(nums: List[int]) -> int:
      """
      You are given an array nums consisting of positive integers.
  
      Return the total frequencies of elements in nums such that those elements all have the maximum frequency.
  
      The frequency of an element is the number of occurrences of that element in the array.
  
      Examples:
      >>> nums = [1,2,2,3,1,4]
      4
      >>> nums = [1,2,3,4,5]
      5
  
      Constraints:
      1 <= nums.length <= 100
      1 <= nums[i] <= 100
      """
  
output: 
      freq = Counter(nums)
      max_freq = max(freq.values())
      return sum(count for count in freq.values() if count == max_freq)
  