#!/usr/bin/env python3
import re

n = int(input())
s = input()

min = n

for i in range(n-1):
    count = 0
    if(s[i] == '#' and s[i+1] == '.'):
        for j in range(i):
            if(s[j] == '#'):
                count += 1
        for k in range(i+1,n):
            if(s[k] == '.'):
                count += 1
        if(min > count):
            min = count
if(min == n):
    print(0)
else:
    print(min)
