n = int(input())

a = list(input())
su = 0
co = 0
if a[-1] == "#":
	co = 2
for i in range(n-1):
	if co == 1:
		if a[-(i+2)] == "#":
			su += 1
	if a[-(i+2)] == "#" and co != 2:
		co = 1
		if i == n-2:
			su += 1
	elif a[-(i+2)] == ".":
		co = 0
print(su)
