Counting rational points in arithmetic varieties by the determinant