Calculate episode numbers locally