N = int(input())
S = list(input())
S2 = S.copy()

res = 0
res2 = 0

j = 0
while True:
    if S[j]=="#":
        break
    j+=1

for i in range(j+1,N):
    if S[i]=='.' and S[i-1]=='#':
        S[i]='#'
        res+=1

    if S2[i]=='.' and S2[i-1]=='#':
        S2[i-1]='.'
        res2+=1

if res>res2:
    print(res2)
else:
    print(res)
