N = int(input())
S = str(input())

s = S
first_sharp = s.find('#')
if first_sharp == -1:
    print(0)
else:
    s = s[first_sharp:]

    ans = 2 * 10 ** 5
    for i in range(len(s)):
        #print(S[:i], S[i:])
        sharp_num = s[i:].count('#') # 後ろを#→.
        dot_num = s[:i].count('.') # 前を . → #
        ans = min(ans, dot_num + sharp_num)
    print(ans)