n = int(input())
s = input()
data = list()
ans = list()
for i in range(n+1):
    data.append("." * i + "#" * (n-i))
#print(data)
for i2 in data:
    tmp = 0
    for i in range(n):
        if i2[i] != s[i]:
            tmp += 1
    ans.append(tmp)
print(sorted(ans)[0])

