I have some data that describes workers login and logout times.

I'm calculating sum of minutes per workshift (which is 8 hours) when workers are logged in.

For example shift starts at 08:00AM and ends 02:00PM. Time is now 11:30 and login logout data i have so far is:

Where m is login time and n is logout time.

Ok, sum of this is sum of differences of each logout-login time and we get:

115+95+150 = 360 minutes.

How to represent this summation with summation notation?

Notation should be working in general since we don't have any matrix data exists for example future login logout times.