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

ans1 = 0
flag = 0
for i in range(1,N+1):
    if S[-i] == '.':
        flag = 1
    else:
        if flag == 1:
            ans1 += 1

flag = 0
ans2 = 0
for j in range(N):
    if S[j] == '#':
        flag = 1
    else:
        if flag == 1:
            ans2 += 1

print(min(ans1,ans2))
