import java.util.* ;
interface alc2_tgr {
   static void main(String[] args) {
      String s = new Scanner(System.in).next() ;
      int c0 = 0, c1 = 0 ;
      for (int a = (s.length()-2) / 2, b = s.length() - 1 -a; a>=0; a--, b++) {
         boolean m = (s.charAt(a) == s.charAt(b)) ;
         int nc0 = 1000000000, nc1 = 1000000000 ;
         for (int i=0; i<=2; i++) {
            if ((m || i != 0) && (!m || (i != 1))) {
               if (i >= 1)
                  nc0 = Math.min(nc0, i + c1) ;
               if (i != 1)
                  nc0 = Math.min(nc0, i + c0) ;
            }
            if (!m || i != 0) {
               if (i >= 1)
                  nc1 = Math.min(nc1, i + c1) ;
               if (i != 1)
                  nc1 = Math.min(nc1, i + c0) ;
            }
         }
         c0 = nc0 ;
         c1 = nc1 ;
      }
      System.out.println(c0) ;
   }
}
