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

S_map = [1 if i=="." else 0 for i in S]
ans = []

for i in range(N+1):
    if(i == 0 or i == N or S[i-1] != S[i]):
        if(i != 0):
            left_white = sum(S_map[:i])
            left_black = i - left_white
        else:
            left_white = 0
            left_black = 0
        if(i != N):
            right_white = sum(S_map[i:])
            right_black = (N - i) - 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))