import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n = ni()
s = list(ns())
w = 0
b = 0
l = 0
count = 0
white = ['.' for _ in range(n)]
black = ['#' for _ in range(n)]
for i in range(n):
    if s[i] == '#':
        count += 1
lis = ['.' for i in range(n)]
for i in range(n - count, n):
    lis[i] = '#'
for i in range(n):
    if s[i] != white[i]:
        w += 1
    if s[i] != black[i]:
        b += 1
    if s[i] != lis[i]:
        l += 1
print(min(w, b, l))
