# -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 21:15:50 2019

@author: doppe
"""

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

countBlack = 0
countWhite = 0

for c in S:
    if (c == '.'):
        countWhite += 1
    else:
        countBlack += 1

countRightWhite = 0
countLeftBlack = 0
for c in S:
    if (c == '.'):
        countRightWhite += 1
    else:
        break
for c in range(len(c) - 1, -1, -1):
    if (S[c] == '#'):
        countLeftBlack += 1
    else:
        break

black = countWhite - countRightWhite
white = countBlack - countLeftBlack

if (white < black):
    print(white)
else:
    print(black)