import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    s = str(readline().rstrip().decode('utf-8'))
    w = s.count(".")
    b = 0
    mc = 10 ** 10
    for i in range(n):
        if s[i] == "#":
            b += 1
        else:
            w -= 1
        mc = min(mc, b + w)
    print(mc)


if __name__ == '__main__':
    solve()
