#!/usr/bin/perl
#
# Title: 	IP to Long
#
# File: 	iptolong.pl
#
# Description:	Converts IPs to Longs
#
# Written by:	raffael.marty@arcsight.com (ram)
#
# URL:		http://afterglow.sourceforge.net
#
###############################################################################/

use strict;

sub dottedQuadToNum(@){
    my ($ip)=@_;
    my @sip = split(/\./,$ip);
    return (@sip[0]*(256 * 256 * 256))+(@sip[1]*(256 * 256))+(@sip[2] * 256) + (@sip[3]);

}


while (<STDIN>) {
	chomp;
	my @a=split",";
	printf( "%s,%s,%s\n",dottedQuadToNum($a[0]),dottedQuadToNum($a[1]),$a[2]);
}

