A sequence {S(x)}, each of whose terms is a positive integer, is defined as:
S(x) = x/2, if x is even, and:
S(x) = x+3, if x is odd
Given that n is an odd positive integer and, S(S(S(n))) = 27, determine sod(n).
Note: sod(n) denotes the sum of the base-10 digits of n.