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

ans = [0 for i in range(n + 1)]

for i in range(n):
    for j in range(n + 1):
        if j <= i:
            if s[i] == '.':
                ans[j] += 1
        else:
            if s[i] == '#':
                ans[j] += 1
print(min(ans))

