N = int(input())
a = list(input())
result = N
count = 0
white = [1 if n == '.' else 0 for n in a]
for i in range(N+1):
	count = i-sum(white[0:i])+sum(white[i:N])
	if result > count:
		result = count
print(result)