Counting oracle calls code