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()
    S = [s for s in S]

    cnt2 = 0
    for i in range(0, N - 1):
        if S[i] == '#' and S[i + 1] == '.':
            cnt2 += 1

    cnt1 = 0
    for i in range(0, N - 1):
        if S[i] == '#' and S[i + 1] == '.':
            S[i + 1] = '#'
            cnt1 += 1

    print(min(cnt1, cnt2))
