n = int(input())
s = input()
counter = 0
counter = s.count('.')
result = n
for i in s:
    if i == '#':
        counter += 1
    else:
        counter -= 1
    result = min(result, counter)
print(result)