stone=input()
color=input()
a=int(stone)
counter=0
black = 0
white = 0
xxx=[9999]
list=[]
for i in range(a):
    list.append(color[i])
for i in range(a):
    if list[i]=='#':
        xxx.append(i)
        black += 1
    if list[i]=='.':
       white += 1
if min(xxx)==9999:
    s=9999
else:
    s = min(xxx)
for k in range(s,a):
    if list[k]=='.' :
        counter = 1+ counter
if black > white:
    print(black)
else:
    if s==9999:
        print('0')
    else:
        print(counter)