import sys
N = int(input())
S = list(input())

count_W = 0
for i, s in enumerate(S):
    if s == '#':
        count_W = S[i:].count('.')
        break

count_B = 0
for i in range(len(S)):
    if S[-(i + 1)] == '.':
        count_B = S[: -(i + 1)].count('#')
        break

print(min([count_W, count_B]))