input: from typing import List
  from functools import reduce
  import math
  def minimize_array_length(nums: List[int]) -> int:
      """
      Given a list of positive integers named nums.
  
      Your objective is to reduce the length of nums by repeatedly performing the following steps any number of times:
  
      Choose two different indices i and j from nums, where both nums[i] and nums[j] are positive.
  
      Append the value of nums[i] % nums[j] to the end of nums.
  
      Remove the elements at indices i and j from nums.
  
      Return the smallest possible length of nums after applying the above operations any number of times.
  
      Examples:
      >>> nums = [1,4,3,1]
      1
      >>> nums = [5,5,5,10,5]
      2
      >>> nums = [2,3,4]
      1
  
      Constraints:
      1 <= len(nums) <= 10^5
      1 <= nums[i] <= 10^9
      """
output:     
      if not nums:
          return 0
  
      def gcd(a, b):
          while b:
              a, b = b, a % b
          return a
  
      return reduce(gcd, nums)
  