def main():

    N = int(input())
    S = input()
    search = False
    count = 0
    for i in range(N):
        if S[i] == "#" and not search:
            search = True
        if S[i] == "." and search:
            count += 1
    return count

if __name__ == '__main__':
    print(main())