#!/snap/bin/pypy3

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

    whitestones = []
    tmpcount = 0
    for stone in S:
        if stone == '.':
            tmpcount += 1
        whitestones.append(tmpcount)

    totalwhite = whitestones[-1]

    print(min(i - wstone + totalwhite - wstone for i, wstone in enumerate(whitestones, start=1)))


if __name__ == '__main__':
    main()
