import sys


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


if __name__ == '__main__':
    solve()
