m, n = map(int, input().split()) m += n/3 if (n % 3 == 0): print(m) elif (n % 3 == 1): print("{}.3333333333333".format(m)) else: print("{}.6666666666667".format(m))