import re
N = int(input())
S = input()

CT=0
for j in range(len(S)):
    if S[j] == ".":
        CT+=1

#NG: #.
#OK: .#
CH=0
A=CT+CH
for i in range(len(S)):
    if S[i] == ".":
        CT-=1
    if S[i] == "#":
        CH+=1
        break

    A=min(CT+CH, A)

print(A)
