import java.io.PrintWriter
import java.lang.Math.floor

val pw = PrintWriter(System.out)
fun println(x: Any) {
    pw.println(x)
}

fun main(args: Array<String>) {
    val a = nextInt()
    val p = nextInt()
    val ans = solve(a = a, p = p)
    println(ans)
    pw.flush()
}

fun solve(a: Int, p: Int): Int {
    val pieces = p + a * 3
    return floor(pieces / 2.0).toInt()
}

// Parsing args
fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun listOfString() = next().split(" ")
fun listOfInt() = next().map { it.toInt() }
fun listOfLong() = next().map { it.toLong() }
fun listOfDouble() = next().map { it.toDouble() }
