Calculates 531 program