import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_nl = lambda: list(map(int, readline().split()))
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    N = in_n()
    S = list(in_s())

    if S.count('#') == 0:
        print(0)
        exit()

    l = S.index('#')
    ans = S[l:N].count('.')
    print(ans)


if __name__ == '__main__':
    main()
