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

def f(i, j):
	if j >= i:
		return "#"
	else:
		return "."

ans = float("inf")
for i in range(N+1):
	tmp = 0
	for j in range(N):
		if S[j] != f(i, j):
			tmp += 1
	if tmp < ans:
		ans = tmp
print(ans)