N = int(input())
S = str(input())
white_count = 0
black_count = 0
count = 0
for i in range(N):
    if S[i] == ".":
        white_count += 1
    else:
        black_count += 1
        if i != N-1 and S[i+1] == ".":
            count += 1
print(min(white_count,black_count,count))

