n = int(input())
s = str(input())
ans = 200000
for i in range(n):
    x = 0
    for k in range(i + 1):
        if s[k] == '#':
            x += 1
    for k in range(n - i - 1):
        if s[k] == '.':
            x += 1
    if x < ans:
        ans = x
print(ans)
