N = int(input())
stone_list = list(input())
stone_list.append('end')
if stone_list[0] == '#':
    stone_list.insert(0,'.')

normalized_list = []
count = 0
stone = stone_list[0]
for s in stone_list:
    if s == stone:
        count += 1
    else:
        normalized_list.append(count)
        count = 1
        stone = s
    

total_a = 0
for i in range(1,len(normalized_list)-1,2):
    total_a += normalized_list[i]
    
total_b = 0
for i in range(2,len(normalized_list),2):
    total_b += normalized_list[i]

print(min(total_a,total_b))