import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n = int(readline())
s = readline().rstrip().decode('utf-8')
res = s.count(".")
res2 = res
ans = 10**10
for i in range(n):
    if s[i] == "#":
        res2 += 1
    else:
        res2 -= 1
    ans = min(res,res2)

print(ans)