gets
puts gets.chomp
  .gsub(/a+/, 'a')
  .gsub(/b+/, 'b')
  .gsub(/c+/, 'c')
  .gsub(/d+/, 'd')
  .gsub(/e+/, 'e')
  .gsub(/f+/, 'f')
  .gsub(/g+/, 'g')
  .gsub(/h+/, 'h')
  .gsub(/i+/, 'i')
  .gsub(/j+/, 'j')
  .gsub(/k+/, 'k')
  .gsub(/l+/, 'l')
  .gsub(/m+/, 'm')
  .gsub(/n+/, 'n')
  .gsub(/o+/, 'o')
  .gsub(/p+/, 'p')
  .gsub(/q+/, 'q')
  .gsub(/r+/, 'r')
  .gsub(/s+/, 's')
  .gsub(/t+/, 't')
  .gsub(/u+/, 'u')
  .gsub(/v+/, 'v')
  .gsub(/w+/, 'w')
  .gsub(/x+/, 'x')
  .gsub(/y+/, 'y')
  .gsub(/z+/, 'z')
  .length
