Chatushra jaati tihais

Let us first define the following variables: Example: (A B C D E F G H धा -)*3 would give us a 7 beat tihai. So, N=7, S=8, V=1
A B C D E F G H धा - A B C D E F G H धा - A B C D E F G H
धा -

Here's the formula to determine S and V for any N: