N = int(input())
S = list(input())
num_w = 0
num_b = 0
exist_black = False
black = False
for i in range(N):
    if S[i] == '#':
        exist_black = True
        black = True
        if i != N-1 and S[i+1] == '.' and exist_black == True:
            num_b += 1

    elif S[i] == '.':
        black = False
        if exist_black == True:
            num_w += 1

if num_b <= num_w:
    print(num_b)
else:
    print(num_w)