Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

TOPALIN - Palindrome String

You are given a string and are allowed to perform some operators on this string. In each operator, you can change all characters of a type to another type. The cost of an operator is the number of characters affected. The cost of several operators is the total cost of each individual operator.

For example, the string acaabc will become abaabbif you change all c's to b's. The cost of this operator is 2 since there are 2 c's in the first string.

What is the minimum cost to make the given string a palindrome?

Input

  • The original string is given in the first line.

Output

  • The minimum cost to make the string a palindrome.

Example

Input:
acaabc


Output:
3

Constraints

  • The length of the input string does not exceed 105.
  • Each character of the input string is either a letter or a digit.
  • In 50% of the test cases, the length of the input string does not exceed 100.

ãy

Được gửi lên bởi:VOJ Team
Ngày:2009-07-02
Thời gian chạy:0.200s
Giới hạn mã nguồn:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Ngôn ngữ cho phép:Tất cả ngoại trừ: ERL GOSU JS-RHINO NODEJS PERL6 PYPY RUST SED VB.NET
Nguồn bài:VNOI Marathon 2009 - Warm up Round

hide comments
2018-04-24 06:20:12
Bài cũng bt, nếu đánh giá thang 5 sao thì bài này được 2.5* -> 3*
2017-02-27 15:03:29
bài rất hay + thuật toán ảo diệu :))
@phanduy16
2016-09-20 10:42:46
Bài này hay :)
2016-04-29 12:28:54 Nguyễn Nam
HAY !
2015-10-01 07:43:32 shaha
làm kí tự 'a'..'z' được 50 đọc lại đề thấy mình sai
2015-09-20 10:22:48 [Nghien] Le Long
Duyệt trâu AC???
2014-05-12 17:46:24 Anh Duc Le
Công nhận bài này rất hay !
2013-06-21 14:53:24 Zịt Kon Kute
hay !!
2012-08-17 08:16:01 Trần Vũ Lâm
Del

Last edit: 2012-08-17 08:17:00
2010-12-17 00:44:15 xuanson94
bai nay hay that
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.