N = int(input())
S = input().rstrip()

cnts_b_from_r = [0 for i in range(-1,N)]
cnts_w_from_l = [0 for i in range(-1,N)]

# count num for each color
lst = list(S)
last_black = 0
for i,val in enumerate(lst):
	if S[i] == "#":
		last_black += 1
	
	cnts_b_from_r[i] = last_black
	
lst.reverse
last_white = 0
for i,val in enumerate(lst):
	if val == ".":
		last_white += 1
	
	cnts_w_from_l[i] = last_white

min_val = N
for i in range(-1,N):
	new_val = cnts_b_from_r[i] + cnts_w_from_l[N-(i+2)]
	min_val = min(new_val,min_val)

print(min_val)