Let X be a smooth projective curve over a field of characteristic zero and let D be a non-empty set of rational points of X. We calculate the motivic classes of moduli stacks of semistable parabolic bundles with connections on (X, D) and motivic classes of moduli stacks of semistable parabolic Higgs bundles on (X, D). As a by-product we give a criteria for non-emptiness of these moduli stacks, which can be viewed as a version of the Deligne-Simpson problem.