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

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

needs = [n]
cnt = 0
for i in range(n):
    if s[i] == "#":
        need = 0
        cnt += 1
        for j in range(i,n):
            if s[j] == ".":
                need += 1
        needs.append(need + cnt - 1)
need = min(needs)

black = 0
for i in range(n):
    if s[i] == "#":
        black += 1

print(min(black,need))