N = int(input())
S = input()
binS = []
for i in range(N):
    if S[i] == '.':
        binS.append(0)
    else:
        binS.append(1)
# print(binS)

dp = [0]
for i in range(1, N):
    if binS[i-1] == 1 and binS[i] == 0:
        dp.append(dp[i-1]+1)
    else:
        dp.append(dp[i-1])

print(dp[-1])
