stone=input()
color=input()
a=int(stone)
result=100000
counter=0
counter2=0
black = 0
white = 0
xxx=[]
yyy=[]
list=[]
list2=[]
for i in range(a):
    list.append(color[i])
for i in range(a):
    for j in range(0,i):
        if list[j]=='#':
            counter = counter+1
    for k in range(i,a):
        if list[k]=='.':
            counter = counter+1
    if result > counter:
      result=counter
print(result)