char input[]="3A3529A171";
char mId[11];

//long long erg = 1000000000000LL;
//long long tmp = 1000000000000LL;

uint64_t erg;
uint64_t tmp;

int digit;

int hex2int(char ch)
{
    if (ch >= '0' && ch <= '9')
        return ch - '0';
    if (ch >= 'A' && ch <= 'F')
        return ch - 'A' + 10;
    if (ch >= 'a' && ch <= 'f')
        return ch - 'a' + 10;
    return -1;
}

void setup() {
  Serial.begin(9600);
  // put your setup code here, to run once:
  for(int i=0,y=9; i < strlen(input) ; i++,y--){
    digit = hex2int(input[i]);
    tmp = digit * pow(16,y);
    erg += tmp;
  }
  //Serial.println(erg-1000000000000LL);
  Serial.println(erg);
}

void loop() {
  // put your main code here, to run repeatedly:
}