N = int(input())
S = input()
w_cnt = S.count('.')
b_cnt = 0
changes = [0]*N
for i in range(N):
    if S[i] == '.':
        changes[i] = b_cnt + w_cnt
        w_cnt -= 1
    else:
        changes[i] = b_cnt + w_cnt
        b_cnt += 1
#print(changes)
print(min(changes))



