N = int(input())
S = input()

if ('.' not in S) or ('#' not in S):
    print(0)
    exit()


def period_change(string):
    flag = False
    cnt = 0
    for char in string:
        if char == '#':
            flag = True
            continue

        if char == '.' and flag:
            cnt += 1
            flag = True
            continue

        flag = False

    return cnt


def sharp_change(string):
    flag = False
    cnt = 0
    for char in string:
        if char == '.':
            flag = True
            continue

        if char == '#' and flag:
            cnt += 1
            flag = True
            continue

        flag = False

    return cnt


print(min(period_change(S), sharp_change(S)))
