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