compute term_cout, idf

cc