N,S = open(0).read().split()
N=int(N)
S=list(S)

def count():
    group = [] if S[0] == '.' else [0]
    n = 0
    mark = S[0]
    for s in S:
        if s == mark:
            n += 1
        else:
            mark = s
            group.append(n)
            n = 1
    if n > 0:
        group.append(n)
    if mark == '#' and group:
        group.pop()
    return group

group = count()

def white():
    cnt = 0
    for i in range(2, len(group), 2):
        cnt += group[i]
    return cnt

def black():
    cnt = 0
    for i in range(1, len(group), 2):
        cnt += group[i]
    return cnt

print(min(white(), black()))