Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
nums = list(map(int, input().split()))
count = [0]*N
nums.sort()
answer = N
for i in range(N):
  fNum = nums[i]
  for j in range(N):
    sNum = nums[j]
    if (sNum > fNum):
      break
    elif (i == j):
      continue
    else:
      if (fNum%sNum == 0):
        answer -= 1
        break

print(answer)


Fixed submission:
N = int(input())
nums = list(map(int, input().split()))
nums.sort()
div_length = max(nums)+1
divisible_list = {}
#initialize
for i in range(0, div_length):
  divisible_list[i] = 0

#count divisible numbers
for fNum in nums:
  for j in range(fNum, div_length, fNum):
   	divisible_list[j] += 1

#check for numbers
answer = 0
for num in nums:
  if (divisible_list[num] == 1):
    answer += 1
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
nums = list(map(int, input().split()))
count = [0]*N
nums.sort()
answer = N
for i in range(N):
  fNum = nums[i]
  for j in range(N):
    sNum = nums[j]
    if (sNum > fNum):
      break
    elif (i == j):
      continue
    else:
      if (fNum%sNum == 0):
        answer -= 1
        break

print(answer)

  
  



Fixed submission:
N = int(input())
nums = list(map(int, input().split()))
nums.sort()
div_length = max(nums)+1
divisible_list = {}
#initialize
for i in range(0, div_length):
  divisible_list[i] = 0

#count divisible numbers
for fNum in nums:
  for j in range(fNum, div_length, fNum):
   	divisible_list[j] += 1

#check for numbers
answer = 0
for num in nums:
  if (divisible_list[num] == 1):
    answer += 1
print(answer)

Buggy python submission (verdict: Runtime Error):
N = int(input())
nums = list(map(int, input().split()))
count = [0]*N
nums.sort()
answer = N
for i in range(N):
  fNum = nums[i]
  for j in range(N):
    sNum = nums[j]
    if (sNum > fNum):
      break
    elif (i == j):
      continue
    else:
      if (fNum%sNum == 0):
      	answer -= 1
        break

print(answer)

    
  



Fixed submission:
N = int(input())
nums = list(map(int, input().split()))
nums.sort()
div_length = max(nums)+1
divisible_list = {}
#initialize
for i in range(0, div_length):
  divisible_list[i] = 0

#count divisible numbers
for fNum in nums:
  for j in range(fNum, div_length, fNum):
   	divisible_list[j] += 1

#check for numbers
answer = 0
for num in nums:
  if (divisible_list[num] == 1):
    answer += 1
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
nums = list(map(int, input().split()))
count = [0]*N
nums.sort()
for i in range(N):
  fNum = nums[i]
  for j in range(0,N):
    if (nums[j] > fNum):
      break
    if (count[i] == 1):
      break
    if (i == j):
      continue
    else:
      sNum = nums[j]
      if (fNum%sNum == 0):
      	count[i] += 1
answer = 0
for i in count:
  if (i == 0):
    answer += 1
print(answer)

  
    
  



Fixed submission:
N = int(input())
nums = list(map(int, input().split()))
nums.sort()
div_length = max(nums)+1
divisible_list = {}
#initialize
for i in range(0, div_length):
  divisible_list[i] = 0

#count divisible numbers
for fNum in nums:
  for j in range(fNum, div_length, fNum):
   	divisible_list[j] += 1

#check for numbers
answer = 0
for num in nums:
  if (divisible_list[num] == 1):
    answer += 1
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
nums = list(map(int, input().split()))
count = [0]*N

for i in range(N):
  fNum = nums[i]
  for j in range(N):
    if (count[j] == 1):
      continue
    elif (i == j):
      continue
    else:
      sNum = nums[j]
      if (sNum%fNum == 0):
      	count[j] += 1
answer = 0
for i in count:
  if (i == 0):
    answer += 1
print(answer)


Fixed submission:
N = int(input())
nums = list(map(int, input().split()))
nums.sort()
div_length = max(nums)+1
divisible_list = {}
#initialize
for i in range(0, div_length):
  divisible_list[i] = 0

#count divisible numbers
for fNum in nums:
  for j in range(fNum, div_length, fNum):
   	divisible_list[j] += 1

#check for numbers
answer = 0
for num in nums:
  if (divisible_list[num] == 1):
    answer += 1
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
nums = list(map(int, input().split()))
count = [0]*N

for i in range(N):
  fNum = nums[i]
  for j in range(N):
    if (count[j] == 1):
      continue
    elif (i == j):
      continue
    else:
      sNum = nums[j]
      if (sNum%fNum == 0):
      	count[j] += 1
answer = 0
for i in count:
  if (i == 0):
    answer += 1
print(answer)


Fixed submission:
N = int(input())
nums = list(map(int, input().split()))
nums.sort()
div_length = max(nums)+1
divisible_list = {}
#initialize
for i in range(0, div_length):
  divisible_list[i] = 0

#count divisible numbers
for fNum in nums:
  for j in range(fNum, div_length, fNum):
   	divisible_list[j] += 1

#check for numbers
answer = 0
for num in nums:
  if (divisible_list[num] == 1):
    answer += 1
print(answer)