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())
i = 0
j = n - 1
count = 0
f1 = 0
f2 = 0
while(i < j - 1):
    if s[i] == '#':
        f1 = 1
    else:
        i += 1
    if s[j] == '.':
        f2 = 1
    else:
        j -= 1
    if f1 == 1 and f2 == 1:
        s[i], s[j] = s[j], s[i]
        count += 2
        f1 = 0
        f2 = 0
        i += 1
        j -= 1
if s[i] != s[j]:
    count += 1
print(count)
