n=int(input())
s=input()
cnt_b,cnt_w=0,0
switch=0
for i in range(n):
    if s[i]=='#':
        switch=1
        if s[i:] in '.':
            cnt_b+=1
    if switch==1 and s[i]=='.':
        cnt_w+=1
if s[n-1]=='#':
    cnt_b-=1
print(min(cnt_b,cnt_w))