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

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

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

ans2 = 0

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

ans = ans1 if ans1 < ans2 else ans2
print(ans)
