import itertools
n = int(input())
s = [i for i in input()]
ans = 0
gr = itertools.groupby(s)
cnt = 0
for k, g in gr:
    if k == ".":
        if cnt == 0:
            cnt += 1
            continue
        else:
            ans += 1
    cnt += 1
print(ans)