import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


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


if __name__ == '__main__':
    N = int(input())
    S = input()

    cnt_w = 0
    for s in S:
        if s == '.':
            cnt_w += 1

    ans = 1000000000
    cnt_b = 0
    flag = False
    for i in range(0, N - 1):
        if S[i] != S[i + 1]:
            flag = True
            ans = min(ans, cnt_b + cnt_w)
        elif S[i] == S[i + 1] and S[i] == '.':
            cnt_w -= 1
        elif S[i] == S[i + 1] and S[i] == '#':
            cnt_b += 1

    if flag:
        print(ans)
    else:
        print(0)
