The Suffering of 5
InterviewTime limit1sMemory limit1024 MB
Read a five-digit number and print the sum of the fifth powers of its five digits.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Kipa suddenly thought of 5, which never gets the spotlight because the solid walls of 3 and 4 block it. 'So many things in the world are related to 5!'
Kipa began to think of places where 5 is used. A person has 5 fingers, there are 5 regular polyhedra, the only known untouchable odd number is 5, stars are usually five-pointed, and above all, "five stars!"
Then Kipa suddenly felt a desire rising in his heart to raise things to the fifth power. For Kipa, write a program that takes a five-digit number as input and prints the sum of the fifth powers of its digits.
Input
The first line gives a positive integer with five digits. The given satisfies .
Output
Print the sum of the fifth powers of the digits on the first line.