#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let s = read::<String>()
        .chars()
        .map(|x| x.to_digit(36).unwrap() as usize - 10)
        .collect::<Vec<_>>();
    let n = s.len();
    let mut counts = vec![vec![0; s.len() + 1]; 26];
    let mut poses = vec![vec![]; 26];
    for ch in 0..26 {
        for i in 0..s.len() {
            counts[ch][i + 1] = counts[ch][i];
            if s[i] == ch {
                counts[ch][i + 1] += 1;
                poses[ch].push(i);
            }
        }
    }
    let mut cur = 0;
    let mut ans = 0;
    loop {
        let mut end = n - 1;
        loop {
            let mut odd_poses = vec![];
            for ch in 0..26 {
                if (counts[ch][end + 1] - counts[ch][cur]) % 2 == 1 {
                    let idx = poses[ch].lower_bound(&cur);
                    odd_poses.push(poses[ch][idx]);
                }
            }
            if odd_poses.len() <= 1 {
                break;
            }
            odd_poses.sort();
            end = odd_poses[1] - 1;
        }

        ans += 1;
        cur = end + 1;
        if cur == n {
            break;
        }
    }
    println!("{}", ans);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

use std::cmp::Ordering;

pub trait BinarySearch<T> {
    fn lower_bound(&self, x: &T) -> usize;
    fn upper_bound(&self, x: &T) -> usize;
}

impl<T: Ord> BinarySearch<T> for [T] {
    fn lower_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less => {
                    low = mid + 1;
                }
                Ordering::Equal | Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }

    fn upper_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less | Ordering::Equal => {
                    low = mid + 1;
                }
                Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
}
