n = int(input())
s = input()
if len(set(s)) == 1:
    print(0)
else:
    rs = s[::-1]
    f1 = s.index('#')
    f2 = n - rs.index('.') - 1
    # print(f1,f2)
    ans = min(s[f1:].count('.'), s[:f2].count('#'))
    print(ans)
