def read_input():
    n = int(input())
    s = input().strip()

    return n, s


def split_sentence(s):
    temp = s[0]
    result = []

    for i in range(1, len(s)):
        if temp[-1] == '.' and s[i] == '#':
            result.append(temp)
            temp = s[i]
        else:
            temp += s[i]

    result.append(temp)

    return result

def count_min_color(t):
    white = 0
    black = 0

    for c in t:
        if c == '.':
            white += 1
        else:
            black += 1

    return min(white, black)


if __name__ == '__main__':
    n, s = read_input()

    r = split_sentence(s)
    r = [count_min_color(rr) for rr in r]
    print(sum(r))