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

for i, s in enumerate(S):
    if s == '#':
        n = S[i:].count('.')
        break
    else:
        n = 0
for i, s in enumerate(reversed(S)):
    if s == '.':
        m = S[i:].count('#')
        break
    else:
        m = 0
print(min(n, m))