# -*- coding: utf-8 -*-

n = int(input())

s = list(input())

count = 0

# for i in range(n-1):
#     if s[i] == '#' and s[i+1] == '.':
#         if i == 0:
#             s[0] = '.'
#             count += 1
#             continue
#
#         if s[i-1] == '#':
#             s[i+1] = '#'
#             count += 1
#         elif s[i-1] == '.':
#             s[i] = '.'
#             count += 1


for i in range(n-1):
    if s[i] == '#' and s[i+1] == '.':
        if i == 0:
            s[0] = '.'
            count += 1
            continue

        if i == n-1:
            s[n] = '#'
            count += 1
            continue

        if s[i-1] == '#':
            s[i+1] = '#'
            count += 1
        elif s[i-1] == '.' and s[i+2] == '.':
            s[i] = '.'
            count += 1
        elif s[i-1] == '.' and s[i+2] == '#':
            s[i+1] = '#'
            count += 1


print(count)


