#include <stdio.h>

int main() {
    int g, p, amigo = 0;

    scanf("%d", &g);
    scanf("%d", &p);

    amigo = g * 8 + p * 4 - 2;

    printf("%d\n", amigo);
    
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: