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

num_W = 0  
for i in S:
    if i == ".":
        num_W += 1
num_B = N - num_W

if num_W < num_B:
    print(num_W)
else:
    if S[N-1] == "#":
        last_B = 0
        for j in S[::-1]:
            if j == "#":
                last_B += 1
            else:
                break
        print(num_B - last_B)
    else:
        print(num_B)