On way to Andrew's place: uphill = a, level = b, downhill = c

Coming back: uphill = c, level = b, downhill = a

(a/2 + b/3 + c/6) + (c/2 + b/3 + a/6) = 6

Multiply by 6:

3a + a + 2b + 2b + c + 3c = 36

4(a + b + c) = 36

a + b + c = 9 = one-way distance