"""
#の右に.が無いようにしたい
一番左にある#.もしくは一番右にある#の部分
"""
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n = int(readline())
s = readline().rstrip().decode('utf-8')
res = 0
for i in range(n-1):
    if s[i] == "#":
        if s[i+1] == ".":
            res = i+1
            break
count = 0
if res:
    for i in range(res,n):
        if s[i] == ".":
            count += 1

ans = count
res = n-1
for i in range(n-1,0,-1):
    if s[i] == ".":
        if s[i-1] == "#":
            res = i-1
            break
count = 0
if res != n-1:
    for i in range(res,-1,-1):
        if s[i] == "#":
            count += 1

print(min(ans,count))