N = int(input())
S = input()
ans1 = S[0]
Sr = S[::-1]
ans2 = Sr[0]
cnt1 = 0
cnt2 = 0
for i in range(1, N):
  if ans1[-1]=='#' and S[i]=='.':
    ans1+='#'
    cnt1+=1
  else:
    ans1+=S[i]
  
  if ans2[-1]=='.' and Sr[i]=='#':
    ans2 +='#'
    cnt2 += 1
  else:
    ans2+=Sr[i]

print(min(cnt1, cnt2))