import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    s = input()
    flg = False
    w = 0
    for i in range(n):
        if not flg:
            if s[i] == "#":
                flg = True
        if flg:
            if s[i] == ".":
                w += 1
    flg = False
    b = 0
    for i in reversed(range(n)):
        if not flg:
            if s[i] == ".":
                flg = True
        if flg:
            if s[i] == "#":
                b += 1
    print(min(w, b))


if __name__ == '__main__':
    resolve()
