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

right_black = S.count('#')
right_white = S.count('.')
left_black, left_white = 0, 0

ans = len(S)
for s in S:
    if s == '#':
        right_black -= 1
        left_black += 1
    else:
        right_white -= 1
        left_white += 1

    ans = min(ans, left_black + right_white)

print(ans)