from sys import stdin

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

    if N == 1:
        print(0)
        return

    white, black = [], []
    cntw, cntb = 0, 0
    prev = S[0]
    for s in S:
        if prev != s:
            white.append(cntw)
            black.append(cntb)
            cntw, cntb = 0, 0
        if s == '.':
            cntw += 1
        else:
            cntb += 1
        prev = s
    white.append(cntw)
    black.append(cntb)

    if not sum(white) or not sum(black):
        print(0)
        return
    for i, j in enumerate(black):
        if j:
            idx = i
            break
    w = sum(white[idx:])
    b = sum(black)
    print(min(w, b))

input = lambda: stdin.readline().rstrip()
main()
