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