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

import re

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

S = re.sub(r'^\.+', '', S)

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

print(min([ans, num_white]))
