#!/usr/bin/python
# -*- coding: utf-8 -*-

import re
import sys


re_basic = re.compile('.*\[GRAPH_LOG=([a-zA-Z0-9\._\-]+)\].*')

cnt = {}

providers_available = {'fb', 'vk', 'ok', 'mr', 'tw', 'gg', 'ig', 'lf', 'fs',
                       'lj', 'in', 'ms', 'mt', 'mts-belarus', 'yh', 'ya', 'dz',
                       'social_api', 'apl'}

re_provider_warning = re.compile(
    '''
        .*
        \[WARNING\]
        \[ .*? \]
        \[ .*? \]
        \[ (%s) \]
        .*'
    ''' % '|'.join(providers_available),
    re.VERBOSE,
)

applications_available = {
    'gulfstream-yandex-bass',
}

re_application_warning = re.compile(
    '''
        .*
        \[WARNING\]
        \[ .*? \]
        \[ .*? \]
        \[ .*? \]
        \[ (%s) \]
        .*'
    ''' % '|'.join(applications_available),
    re.VERBOSE,
)

re_appless_warning = re.compile(
    '''
        .*
        \[WARNING\]
        \[ .*? \]
        \[ .*? \]
        \[ - \]
        \[ (-) \]
        .*'
    ''',
    re.VERBOSE,
)


def main():
    for line in sys.stdin:
        res = re_basic.match(line)
        if res:
            items_string = res.groups()[0]
            cnt[items_string] = cnt.get(items_string, 0) + 1
        else:
            for expr in [re_provider_warning, re_application_warning, re_appless_warning]:
                res = expr.match(line)
                if res:
                    provider = res.groups()[0]
                    key = 'warnings.' + provider
                    cnt[key] = cnt.get(key, 0) + 1
                    break

    for key, val in cnt.iteritems():
        print '%s: %d' % (key, val)


if __name__ == '__main__':
    main()
