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

    return n, s


def check_answer(n, s):
    zeros = n

    result = []
    min_diff = n
    for ones in range(n + 1):
        comp = '.' * (zeros - ones) + '#' * ones
        diff = get_diff(comp, s)

        if diff < min_diff:
            min_diff = diff

    return min_diff


def get_diff(s, t):
    count = 0
    for i in range(len(s)):
        if s[i] != t[i]:
            count += 1

    return count


if __name__ == '__main__':
    n, s = read_input()
    print(check_answer(n, s))