On the Complexity of Counterfactual Reasoning