<?php

$n = 10007;
echo ceil(log10(sqrt(2 * M_PI * $n)) + log10($n / M_E) * $n);
