'use strict'
function Main(input){
  var S=input.trim().split('');
  var t=0;
  var a=input.reduce(function(A,c){
    if(t)
      A+=c==='.'?1:0;
    t+=c==='#'?1:0;
    return A;
  },0);
  t=0;
  var b=input.reverse().reduce(function(A,c){
    if(t)
      A+=c==='#'?1:0;
    t+=c==='.'?1:0;
    return A;
  },0);
  var ans=Math.min(a,b);
  console.log(ans);
}

Main(require('fs').readFileSync('/dev/stdin','utf8'));