using System.Text.RegularExpressions;
public static void Main()
string input = "STEAM_1:1:66138017";
var id = TranslateSteamID(input);
public static Int64 TranslateSteamID(string steamID)
var template = new Regex(@"STEAM_(\d):([0-1]):(\d+)");
var matches = template.Matches(steamID);
if (matches.Count <= 0) return 0;
var parts = matches[0].Groups;
if (parts.Count != 4) return 0;
Int64 x = Int64.Parse(parts[1].Value) << 24;
Int64 y = Int64.Parse(parts[2].Value);
Int64 z = Int64.Parse(parts[3].Value) << 1;
result = ((1 + (1 << 20) + x) << 32) | (y + z);