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

s = S

ans = 2 * 10 ** 5
print(ans)
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)