<?php
/*
 $Id: hash.php,v 1.2 2001/05/06 05:25:08 doug Exp $
 http://www.bagley.org/~doug/shootout/
*/
$n = ($argc == 2) ? $argv[1] : 1;
for ($i = 1; $i <= $n; $i++) {
    $X[dechex($i)] = $i;
}
for ($i = $n; $i > 0; $i--) {
    if ($X[$i]) { $c++; }
}
print "$c\n";
?>