def main():
    _ = int(input())
    S = input()
    ps = ''
    ans = 0
    f = False
    for s in S:
        if s == '.' and ps == '#':
            ans += 1
            f = True
        elif s == '.' and ps == '.' and f is True:
            ans += 1
        elif s == '#' and ps == '.' and f is True:
            f = False

        ps = s
    print(ans)


main()
