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


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


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


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

print(min_count)