# -*- coding: utf-8 -*-
N = int(input())
S = list(input())

count = 0
for idx in range(len(S) - 1):
    if S[idx] == '#':
        if S[idx + 1] == '.':
            S[idx + 1] = '#'
            count += 1

print(count)