n = int(input())
s = input()

white = "."
black = "#"

s_list1 = list(s)
s_list2 = list(s)
count1 = 0
count2 = 0
for i in range(len(s)-1):
    if s_list1[i] == black and s_list1[i+1] == white:
        s_list1[i+1] = black
        count1 +=1

    if s_list2[i] == black and s_list2[i+1] == white:
        s_list2[i] = white
        count2 +=1
if count1 > count2: 
    print(count2)
else:
    print(count1)