# TPBC201C - Stones
n = int(input())
s = input()
ans = n
bl_l = 0
wh_r = s.count(".")
for i in s:
    if i == "#":
        bl_l += 1
    else:
        wh_r -= 1
    ans = min(ans, bl_l + wh_r)
print(ans)