n = int(input())
s = list(input())
ss = []
for i in s:
    if i == "#":
        ss.append(1)
    else:
        ss.append(0)

now = 0
cnt = 0
x = []

for i in range(n):
    if ss[i] == now:
        cnt += 1
    else:
        x.append(cnt)
        now = 1 - now
        cnt = 1
if cnt != 0:
    x.append(cnt)
if ss[-1] == 0:
    x.append(0)

#print(x)
x.pop(0)
x.pop(-1)
c1 = 0
c2 = 0
for i in range(len(x)):
    if i % 2 == 0:
        c1 += x[i]
    else:
        c2 += x[i]

print(min(c1,c2))