def read_input():
    n = int(input())
    s = input().strip()

    return n, s


# . -> 0, # -> 1とする
def make_answer_pattern(n):
    zeros = n

    result = []
    for ones in range(n + 1):
        result.append('0' * (zeros - ones) + '1' * ones)

    return result

def convert_s(s):
    return s.replace('.', '0').replace('#', '1')


def get_diff(s, t):
    sb = int(s, 2)
    tb = int(t, 2)

    diffb = sb ^ tb
    diff = bin(diffb)

    return sum([1 for d in diff if d == '1'])

if __name__ == '__main__':
    n, s = read_input()
    target = convert_s(s)

    patterns = make_answer_pattern(n)

    min_diff = n
    for p in patterns:
        diff = get_diff(target, p)
        if diff < min_diff:
            min_diff = diff
            if min_diff == 0:
                break

    print(min_diff)