IDF calculation