#!/usr/bin/env python3
from itertools import*
n = int(input())
l = list(accumulate(map(int, input().translate(str.maketrans("#.","10")))))
q = l[-1]
m = INF = float("inf")
for i in range(n):
    m = min(m, l[i] + n - i - (q - l[i]) - 1)
print(m)