#C - Stones
#黒い石のすぐ右に白い石があるような箇所がないようにしたいです。 

n = int(input())
state = input()
state_list = list(state)
prob_num = 0
state_list.append(" ")
for i in range(n):
	if state_list[i] == "#" and state_list[i+1] == ".":
		prob_num += 1

state_list.remove(" ")
black = state_list.count("#")
white = state_list.count(".")
min_stone = min(black, white)

if min_stone > prob_num:
	if state_list[-1] == "#":
		print(min_ - 1)
	else:
		print(min_)
else:
	print(prob_num)