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

count = 0
while(1):
  if((count == N)or(len(S) == 0)):
    break
  if(S[0] == '.'):
    S.pop(0)
  if((count == N)or(len(S) == 0)):
    break
  if(S[-1] == '#'):
    S.pop(-1)
  count += 1

T = S.copy()
ans1,ans2,ans3 = 0,0,0
for i in range(len(S)):
  if(i != 0):
    if((S[i-1] == '#')and(S[i] == '.')):
      ans1 += 1
      S[i] = '#'
  if(T[i] == '#'):ans2 += 1
  if(T[i] == '.'):ans3 += 1
ans = min(ans1,ans2,ans3)
print(ans)