n = int(input())
s = input()

bc = s[0].count('#')
wc = s.count('.') - (bc^1)
ans = n
for i in range(1,n):
    if s[i] == '.':
        wc -= 1
    if s[i] != s[i-1]:
        ans = min(ans, bc + wc)
    if s[i] == '#':
        bc += 1

if ans == n:
    print(0)
else:
    print(ans)