N = int(input())
S = list(input())
black_exist_num_w = 0
num_b = 0
black = False
for i in range(N):
    if S[i] == '#':
        black = True
        num_b += 1

    elif S[i] == '.':
        if black == True:
            black_exist_num_w += 1

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