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

SLFront = list(S)
SLRear = list(S)

#print(SLFront)
countF = 0
for i in range(len(SLFront)-1):
	if SLFront[i] == "#" and SLFront[i+1] == ".":
		SLFront[i] = "."
		countF += 1
		
#print(countF,SLFront)

#print(SLRear)
countR = 0
for i in range(len(SLRear)-1):
	if SLRear[i] == "#" and SLRear[i+1] == ".":
		SLRear[i+1] = "#"
		countR += 1
		
#print(countR,SLRear)

print(min(countF,countR))