caculate total