import numpy as np
n=int(input())
s=input()
ans = 0
kuro = [0]*(n+1)
siro = [0]*(n+1)
if n==1:
    ans=0
if n ==2:
    if s=="#.":
        ans=1
else: 
    for i,j in enumerate(s[::-1]):
        if j==".":
            kuro[i+1]=kuro[i]+1
        else:
            kuro[i+1]=kuro[i]
    for i,j in enumerate(s):
        if j == "#":
            siro[i+1]=siro[i]+1
        else:
            siro[i+1]=siro[i]
            
ku = np.array(kuro[::-1])
si = np.array(siro)
print(np.min(ku+si))