<?php

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