n = int(input())
s = input()

cntlis = []

for i in range(n+1):
    cnt = 0
    for j in range(i):
        if s[j]=="#":
            cnt += 1
    for j in range(i,n):
        if s[j]==".":
            cnt += 1
    cntlis += [cnt]

print(min(cntlis))