Counting sides

A rectangle that measures 4cm by 6cm is divided into 24 squares with sides 1cm in length. What is the total number of 1cm long sides in those 24 squares? (If 2 squares share a side, the side should be counted only once).

Now I know the answer is 58 and I drew a sketch and counted the sides but I was wondering if there was any shortcut to this problem that I was missing..? Setting up any kind of expression or equation or maybe a combinations problem of some sort?

First count all the right and bottom sides of each square: 24 * 2 = 48. There is no overlap in this counting.
However, we missed some sides with this count. Which ones? The entire top row and left column.
Well, the number of edges we did not count is:
# on top + # on left = 4 + 6 = 10

Grand total is: 48 + 10 = 58

So from this the general solution for number of sides in a n by m block is:
2nm + n + m = n(1 + m) + m(1 + n)

A rectangle that measures 4cm by 6cm is divided into 24 squares with sides 1cm in length.
What is the total number of 1cm long sides in those 24 squares?
(If 2 squares share a side, the side should be counted only once).