def main():
    N = int(input())
    S = list(input())

    cnt = 0
    for i in range(N-1):
        if S[i] == '#' and S[i+1] == '.':
            cnt += 1
    print(cnt)

if __name__ == "__main__":
    main()
