n=int(input())
s=list(input())

cnt1=0
for i in range(n-1):
    if s[i]=='#' and s[i+1]=='.':
        cnt1+=1

#print(cnt1)


cnt2=0
s=s[::-1]
for i in range(1,n):
    if s[i-1]=='.' and s[i]=='#':
        cnt2+=1

print(min(cnt1,cnt2))