# TPBC201C - Stones
n = int(input())
s = input()
if len(set(s)) == 1:
    print(0)
else:
    ans = n
    for i in range(len(s)):
        ans = min(ans, s[:i].count("#") + s[i:].count("."))
    print(ans)