import math
from operator import itemgetter
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
s = S()

cnta = s.count("#")
cntb = s.count(".")
ans = min(cnta,cntb)
f = 0
cnt = 0
for i in range(N):
	if f == 0 and s[i] == ".":
		f = 1
	if f == 1 and s[i] == "#":
		cnt += 1
else:
	ans = min(ans,N-i+1)
	
print(ans)