n = int(input())
s = input()
count = 0
ans = 10 ** 7
for i in s:
    if i == ".":
        count += 1
for i in s:
    if i == "#":
        count += 1
        ans = min(ans,count)
    else:
        count -= 1
        ans = min(ans,count)
print(ans)