How can we create formula for sequence number by concatenating based on status value by taking last digit of status value?

We have 3 status columns named L1, L2, and L3.
In L1, values present like L1.1, L1.2, L1.3.
In L2, values present like L2.1, L2.2, L2.3.
In L3, values present like L3.1, L3.2, L3.3.


In above column L3 is under L2 and L2 is under L1. So here we need to maintain a hierarchy like this:


So we need to concatenate all these 3 columns in one formula to get an exact sequence number.
But when we normally concatenate these above 3 columns we will get an empty word so for that, I used the SUBSTITUTE function. And for taking the last digit value I used the RIGHT function.

But we want this sequence number in different formats like we want only the last digit of this value after concatenating like shown in below picture (Sequence Number column).

So, Suggest a formula to create sequence number.