n = int(input())
s = [str(i) for i in input()]

countw = []
countb = []
for i,j in enumerate(s):
    if s[i] == ".":
        countw.append(i)
    elif s[i] == "#":
        countb.append(i)
if len(countb) == 0 or len(countw) == 0:
    print(0)
    
else:
    maxw = max(countw)
    minb = min(countb)    
    trans1 =  s[:(maxw+1)].count("#")
    trans0 =  s[minb:].count('.')

    print(min(trans1,trans0))
