import numpy

n = int(input())
char = input()

char_list = numpy.array(list(char),dtype=str)

bools = char_list == "#"

result = []

for i in range(n+1):
    result.append(sum(bools[:i]) + len(bools[i:]) - sum(bools[i:]))
print(min(result))