# -*- coding: utf-8 -*-
import sys
import os

x = int(input())
y = list(input())

before = y[0]

for i in range(len(y)):
    if before == '#' and y[i] == '.':
        #ダメポイント見つけた
        #文字列を分割する
        mae = y[:i]
        ushiro = y[i:]
        print(min(ushiro.count('.'), ushiro.count('#')))
        exit(0)
    else:
        before = y[i]

print('0')