N = int(input())
S = input()

l = []
for i in S:
	if i == '#':
		l.append(0) #黒
	else:
		l.append(1) #白



ans = 0
for i in range(len(l)):
	if l[i:i+2] == [0, 1]:
		ans = ans + 1
		l[i+1] = 0


print(ans)
