# -*- coding: utf-8 -*-

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

num_white = 0
num_black = 0
ans = 0
for i in range(N):
    if S[i] == '.':
        ans = num_black
        num_white += 1
    else:
        num_black += 1

print(ans if num_white >= ans else num_white)
