My model have several intervals with startOf and sndOf, say:

[1,30], [45,65], [186,190], in minutes

I would like to minimize the total hours of intervals.

In the above example would be 3: [1,60], [61,90], [180, 240].

How Can I model this?

Thanks.