N = int(input())
S = input()
S = list(map(lambda x: 0 if x=="." else 1, S))
#all_white
# all_white = sum(S)
# all_black = len(S) - all_white

# white, black, white
ans_list = []
for thresh in range(len(S)+1):
    ans = sum(S[:thresh]) + (len(S[thresh:])-sum(S[thresh:]))
    ans_list.append(ans)
print(min(ans_list))