N = int(input())
a = list(input())
c = 0
e = []
st = a[N-1]
f = [st,1]
for i in range(2,N+1):
    if a[N-i] == st:
        f[1] += 1
    else:
        e.append(f)
        st = a[N-i]
        f = [st,1]
e.append(f)
for i in range(len(e) - 1):
    if e[i][0] == ".":
        c += e[i][1]
print(min(c,N-c))