N = int(input())
S = input()

count = 0
sum1 = 0
sum2 = 0
for i in enumerate(S):
  if (i == "#"):
    sum1 += 1
  else:
    sum2 += 1
    
if (sum1 >= sum2):
  for i,char in enumerate(S):
    if (i < len(S) - 1):
      if (char == "#"):
        if (S[i+1] == "."):
          count += 1
else:
  new_S = S[::-1]
  for i,char in enumerate(new_S):
    if (i < len(S) - 1):
      if (char == "."):
        if (new_S[i+1] == "#"):
          count += 1
  
print(count)