n = int(input())
s = input()

sl = list(s)


def count_black(wb):
    return wb.count('#')


def count_white(wb):
    return wb.count('.')


min_count = n
for i in range(1, n):
    if sl[i-1] != sl[i]:
        count = count_black(sl[:i-1]) + count_white(sl[i:])
        if min_count > count:
            min_count = count

print(min_count)