本站作为LDUOnlineJudge的测试版本进行演示,官方网站请访问http://icpc.ldu.edu.cn
[Hidden ☆ before use]

1320. B. Parity of Strings


Description

The historical battle between numbers and strings has taken a new twist: numbers are bragging on their categorization of being “even” or “odd” and strings lacking such feature. But don’t count strings out yet!
A string is considered “even” if every letter in the string appears an even number of times; the string is “odd” if every letter in the string appears an odd number of times.


The Problem:
Given a string, determine whether the string is even, odd, or neither.

Input

The input consists of a single line, starting in column 1, not exceeding column 70, and containing only the lowercase letters (at least one letter).

Output

The output consists of a single integer: print 0 (zero) if the string is even, 1 (one) if the string is odd, or 2 if the string is not even and is not odd (i.e., it is neither).

Samples

Input Copy
coachessoaehwwwwww
Output
0

Source

UCF2018
Problem Information

Time Limit: 1000MS (C/C++,Others×2)
Memory Limit: 128MB (C/C++,Others×2)
Special Judge: No
AC/Submit: 1 / 1
Tags:
Contests involved

1036. UCF 2018
My history solutions

You didn't submit any solution!
Submit your solution

Login Register