import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
S = input()

lis = S.split('.')
maxl = 0
blacks = 0
for l in lis:
    maxl = max(len(l), maxl)
    blacks += maxl

print(blacks-maxl)