calculateUnreadCount