N=int(input())
S=input()

cnt = 0
cnt1 = 0
cnt2 = 0
if N == 1:
    print("0")
    exit()
else:
    for i in range(N-1):
        x = S[i]
        y = S[i+1]
        if x == "#" and y == ".":
            cnt += 1
            if cnt2 == 0:
                S = S.replace(".","#",cnt1+1)
            else:
                S = S.replace(".","#",1)
        if x == ".":
            cnt1 += 1
print(cnt)
