#C9771. Sum of the First and Last Digit

    ID: 53901 Type: Default 1000ms 256MiB

Sum of the First and Last Digit

Sum of the First and Last Digit

Given a positive integer \(N\), compute the sum of its first and last digits. For example, if \(N = 1234\), the first digit is \(1\) and the last digit is \(4\), so the sum is \(1+4=5\).

If \(N\) consists of only one digit, then the digit is added to itself. That is, for \(N = 7\), the sum is \(7+7=14\>.

inputFormat

A single line containing an integer (N).

outputFormat

A single integer representing the sum of the first and last digit of (N).## sample

7
14

</p>