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]

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

    if len(S) >= 2:
        if S[-2] == '#' and S[-1] == '.':
            S[-1] = '#'
            cnt += 1

    print(cnt)
