"""
python3 a.py < input.txt
"""
import math
import itertools as it
import heapq

N=int(input())
S=input()
lb=None
for i in range(N):
    if S[N-i-1] == "#":
        lb=N-i-1
if lb==None:
    print(0)
    exit(0)
rw=None
for i in range(N):
    if S[i]==".":
        rw=i
if rw==None:
    print(0)
    exit(0)
nw=0
nb=0
for i in range(lb, rw-1):
    if S[i] == "#":
        nb = nb+1
    if S[i] == ".":
        nw = nw+1

if lb != None:
    print(min(nb, nw))
else:
    print(0)
