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

s = S

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