#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define LINE_MAX 90

int isNum(char character){
  return (character >=48 && character <= 57);
}


int main(){
  char line[LINE_MAX];
  int sum = 0;
  while (fgets(line, LINE_MAX, stdin) != NULL) {
    char firstNum = ' ';
    char lastNum = ' ';
    for (int i = 0; i < strlen(line); i++){
      if (!isNum(line[i])) continue;
      if (firstNum == ' ') firstNum=line[i];
      lastNum = line[i];
    }
    char fullNum[3] = {firstNum, lastNum, '\0' };
    printf("fN: %c%c\n", firstNum, lastNum);
    sum+=atoi(fullNum);
  }
  printf("answer sum: %d\n", sum);
}

