import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val s = sc.next

  val w =
    0 +:
      s.foldLeft(Vector.empty[Int]){case (v,c) =>
        if(v.isEmpty) Vector( if (c == '.') 1 else 0)
        else v :+ ( v.last + (if(c == '.') 1 else 0))
  }

  val res =
    (0 to n).foldLeft(Int.MaxValue){case (min, i) =>
      val preB  = i - w(i)
      val postW = w(n) - w(i)
      Math.min(min, preB + postW)
  }

  println(res)
}
