calculate F