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

cnt = 0
ans = 0
flag = False
for i in range(N):
    # print(S[i])
    if S[i] == "#": #黒い場合
        if flag: #黒が出てる
            # ans += cnt
            cnt = 0
        else:
            flag = True
    else:#白い場合
        if flag:
            ans += 1
            # ans += cnt
    # print(cnt)
print(ans)