Inspired by this question
Your challenge is very simple: take input in the form of
lookupString string1 string2 ... stringN and output how many pairs of strings there are.
But there's a catch! There are two ways of interpreting "pairs." The first way is combinations. For example,
1 2 3 4 orange orange apple orange orange
orange is the lookup string) has 3 pairs of oranges, since there is #1 and #3, #3 and #4, and #1 and #4.
The second way of interpreting it is adjacent pairs. For example, the same input would have a result of 1 with this interpretation, since there's only one pair in which both oranges are next to each other. (#3 and #4)
You must write two programs, one with the first interpretation and another with the second. Your score is the sum of the length of the two programs. This is code-golf. Shortest score wins.