n = int(input())
s = input()
black_appered = False
ans = 10**9
count =0
# [BBB...WWW...]の組を抽出する
for i in range(n+1):
    left = s[:i]
    right = s[i:]
    count = left.count('#') + right.count('.')
    ans = min(ans,count)
    # print(left," | ", right," | ", count, ans)
print(ans)