Олимпиадный тренинг

Задача 38804. Five digit number - 3


Задача

Темы: Целые числа
The program receives a five-digit number as input. Output  two numbers on the screen separated by a space: the number of digits that are greater than all their neighbors, and the sum of digits whose product with the left neighbor is greater than with the right one (the extreme digits are not considered, since they do not have a second neighbor). If there are no such digits, then print 0.
 
Examples
# Input Output
1 33251 18