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

flag = False
count_w = 0
count_b = 0

count = 0
S_map = []
for i in S:
    if(i=="."):
        count += 1
        S_map.append(count)
    else:
        S_map.append(count)
ans = []
for i in range(N):
    if(i == 0 or S[i-1] == "." and S[i] == "#"):
        if(i != 0):
            left_white = S_map[i]
            left_black = i - left_white
        else:
            left_white = 0
            left_black = 0
        if(i != N-1):
            right_white = S_map[-1] - S_map[i]
            right_black = (N-i-1) - right_white
        else:
            right_white = 0
            right_black = 0
        ans.append(min(left_white+right_white, left_black+right_black, left_black+right_white))
print(min(ans))