import sys
sys.setrecursionlimit(10000000)
def check_and_back_or_go_to(li, ind, N, counter):
    back = True
    # print('see {} {} and {} counter{}'.format(ind, li[ind - 1], li[ind], counter))
    if ind == 0:
        return counter
    elif ind + 1 == N:
        back = False
    # access
    if li[ind - 1] == '#' and li[ind] == '.':
        li[ind] = '#'
        if back:
            c=check_and_back_or_go_to(li, ind + 1, N, counter + 1)
            return c
        c=check_and_back_or_go_to(li, ind - 1, N, counter + 1)
        return c
    else:
        c=check_and_back_or_go_to(li, ind - 1, N, counter)
        return c


N = int(input())
S = list(input())
r = range(N)
count = check_and_back_or_go_to(S, len(S) - 1, N, 0)
print(min([count,N-count]))
