def dif(string, ch):
    res = 0
    for i in range(len(string)):
        if string[i] != ch:
            res+=1
    return res

n = int(input())
string = input()

min = n
for i in range(n+1):
    m = dif(string[:i],"#") + dif(string[i:],".")
    if m < min:
        min = m

print(min)