# coding: utf-8
# Your code here!

N = int(input())
S = input()
count = 0

# for i in reversed(range(len(S) - 1)):
#     if S[i] == '#':
#         count += 1

for i in range(1, len(S)):

    if S[i] == '.':
        if S[i - 1] == '#':
            count += 1

print(count)
