import sys
input=sys.stdin.readline
N=int(input())
S=list(input()[:-1])
b=S.count(".")
w=N-b
j= "#" if w>b else "."
c=0
for i in range(1,N):
  if (S[i-1]==j)and(S[i-1]!=S[i]):
    S[i]=j
    c+=1
print(c)