n = int(input())
s = list(input())
white = s.count('.')
ans, black = float('inf'), 0
for i in s:
    if i == '#':
        black += 1
    elif i == '.':
        white -= 1
    ans = min(ans, white+black)
print(ans)
