n = int(input())

str = input()
count = 0

for i in range(n):
  if str[i] == "#":
    k = i
    for s in range(k,n):
      if str[s] == ".":
        count += 1
    break
    
count2 = 0
i = n-1
while i  >= 0:
  if str[i] == ".":
    k = i
    while k >= 0:
      if str[k] == "#":
        count2 += 1
      k -= 1
    break
  i -= 1


print(count,count2)
print(min(count,count2))
    