import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    N = int(input())
    S = list(input())
    A = S.copy()
    B = S.copy()
    answer1 = 0
    for i in range(1, N):
        if A[i - 1] == "#" and A[i] == ".":
            A[i] = "#"
            answer1 += 1
    answer2 = 0
    for i in range(1, N):
        j = N - i - 1
        if B[j + 1] == "." and B[j] == "#":
            B[j] = "."
            answer2 += 1

    print(min(answer1, answer2))


if __name__ == "__main__":
    main()
