N=int(input())
S=input()
count=0
countB=0
flg=False

for i in range(N):
    if flg == False:
      if S[i] == '#':
          flg = True
          P = i
      else:
        continue

    if S[P] == S[i] :
        countB += 1
        continue
    else:
        count +=1

if count <= (N / 2):
    if count > countB:
        print(countB)
    else:
        print(count)
else:
    print(countB)

