calculate program width