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[1:]:
        if s == '.':
            cnt_w += 1
    cnt_b = 1 if S[0] == '#' else 0

    if (cnt_b == 1) and (cnt_w == 0):
        print(0)
        exit(0)
    if (cnt_b == 0) and (cnt_w == N - 1):
        print(0)
        exit(0)

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

    print(ans)
