def main():
	N = int(input())
	S = input()
	w = 0
	b = 0
	right_w = 0
	right_b = 0

	for i, c in enumerate(S):
		if c == ".":
			w += 1
			right_w = i
		else:
			b += 1
			right_b = i
	ans = min(w, b)
	if right_w < right_b:
		ans = min(ans, b-(right_b-right_w))
	print(ans)


if __name__ == '__main__':
    main()