n = int(input())
s = input()
_min = float('inf')
for i in range(n+1):
    ss = '.'*i + '#' * (n-i)
    t = 0
    for j in range(n):
        if (s[j]) != ss[j]:
            t+=1
    if _min > t:
        _min = t
print(t)