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

if ('#' not in s) or ('.' not in s):
    print(0)
else:
    min_changes = n

    # look for all wb (.#) from left to right
    for i in range(1, n):
        if s[i-1] == '.' and s[i] == '#':
            # count number of b left and w right of wb
            changes = s[:i].count('#') + s[i:].count('.')
            if changes < min_changes:
                min_changes = changes

    print(min_changes)