#!/usr/bin/env cscript
#include "stdio.h"
#include "string.h"
#define ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

int
main(int argc, char *argv[]) {
	int index = 0;
	char *string = "A";

	for (char *needle = string; *needle != '\0'; needle++) {
		index *= 'Z' - 'A' + 1;
		index += strchr(*needle, ALPHABET) - ALPHABET;
	}

	printf("%s → %d\n", string, index);
	return 0;
}