program yet_another_palindrome_partitioning
  implicit none
  integer, parameter :: infty = 1e9
  integer :: n, a(200000), h(0:200000), x, i, j
  integer :: opt(0:200000), dp(200000)
  character(200000) :: s
  a = 0
  h = 0
  opt = 0
  dp = 0
  read(*,*) s
  s = trim(adjustl(s))
  n = len_trim(s)
  do i = 1, n
    a(i) = ichar(s(i:i))-97
    h(i) = xor(h(i-1),lshift(1,a(i)))
  end do
  do i = 1, n
    opt(i) = infty
    do j = 0, i-1
      x = xor(h(i),h(j))
      if (x.eq.0.or.and(x,x-1).eq.0) then
        opt(i) = min(opt(i),opt(j)+1)
      end if
    end do
  end do
  write(*,'(i0)') opt(n)
  stop
end program yet_another_palindrome_partitioning