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

first_black = 0
for i in range(N):
    if (S[i] == '.'):
        continue
    else:
        first_black = i
        break

remain_white = 0
for j in range(first_black, N):
    if S[j] == '.':
        remain_white += 1

last_white = 0
for i in range(N - 1, -1, -1):
    if S[i] == '#':
        continue
    else:
        last_white = i
        break

remain_black = 0
for j in range(last_white):
    if S[j] == '#':
        remain_black += 1

print(min(remain_black, remain_white))
