input1 = input()
input2 = input()
l_input2 = list(input2)
count = 0
tmp_count = 0
if input2.count("#") >= input2.count("."):
    print(input2.count("#."))
else:
    for i in range(0,int(input1)-1):
        if l_input2[i]=="#":
            tmp_count += 1
        else:
            count += tmp_count
            tmp_count = 0
    print(count)