# coding: utf-8

intLength = int(input())
strStones = input()

intCount = 0
strPre = ""
# 黒(#)の右に白(.)がある場合に変更
for intIdx in range(intLength):
    if strPre == "#" and strStones[intIdx] == ".":
        intCount += 1
    strPre = strStones[intIdx]

print(intCount)
