ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

1318. Logarithm

Time limit: 1.0 second
Memory limit: 64 MB
Given a set A of N unordered 128-bit numbers. You are to compute a value of the function
Problem illustration
where Ak is the kth element of A, log10X — the integer part of the decimal logarithm of X. We’ll assume that log100 = 0.

Input

The first input line contains a number N ≤ 5000. In the following N lines there are 128-bit numbers Ak presented by sets of numbers (a1k, a2k, a3k, a4k), each of them lies in range from 0 to 232-1. The number Ak can be obtained from this set according to the formula
Ak = 296a1k + 264a2k + 232a3k + a4k.

Output

You are to output the value of the function for the given set.

Sample

inputoutput
2
0 0 0 2324
0 2332 0 0
44
Problem Author: Idea: Nikita Shamgunov, prepared by Nikita Shamgunov, Anton Botov
Problem Source: VIII Collegiate Students Urals Programming Contest. Yekaterinburg, March 11-16, 2004