N = int(input())
s=list(input())
ii = 9999999999
count_a = 0
count_b = 1
count_c = 0
for index, i in enumerate(s):
  if i == '#' and ii == 9999999999:
    ii = index
    continue;
  elif ii == 9999999999:
    continue;
  else:
    if i == '.':
      count_a+=1
      count_c=0
    else:
      if index != N-1:
        count_b+=1
        count_c+=1
print(min(count_a, count_b-count_c))
