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
count = 0
white = ['.' for _ in range(n)]
black = ['#' for _ in range(n)]

for i in range(n):
    if s[i] != white[i]:
        w += 1
    if s[i] != black[i]:
        b += 1
l = 0
r = n - 1
while(l < r):
    if s[l] == '#':
        s[l] = '.'
        count += 1
        if l + 1 == r:
            break
    if s[r] == '.':
        s[r] = '#'
        count += 1
    l += 1
    r -= 1
print(min(w, b, count))
