Exact formula of repair costs