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

# # 単色のみの場合
# if '.' not in S:
#     print(0)
#     exit()
# elif '#' not in S:
#     print(0)
#     exit()

# それ以外
first_black = 0
white_count = 0
for i in range(N):
    if (S[i] == '.'):
        white_count += 1
    else:
        first_black = i
        break

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

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

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

print(min(remain_black, remain_white))
