N = int(input())
S = list(input())
B_C = 0
W_C = 0
for i in range(N):
    if S[i] == ".":
        W_C += 1
    elif S[i] == "#":
        B_C += 1
#print(W_C,B_C)
#print(min(W_C,B_C))

if B_C >= W_C:
    pair = 0
    for i in range(N-1):
        if S[i] == "#" and S[i+1] == ".":
            pair += 1
    print(pair)
else:
    print(B_C)