#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <sstream>
#include <vector>
#include <iomanip>

using namespace std;

// TODO: Define a struct to hold order state
struct Order {
    string symbol;
    int side;
    int qty;
    double price;
    // TODO: Add other necessary fields
};

// TODO: Implement fast FIX message parsing
void parse_fix_message([[maybe_unused]] const string& line, [[maybe_unused]] unordered_map<string, string>& msg) {
    // Parse pipe-delimited key=value pairs
    // Example: "8=FIX.4.2|35=D|11=ORD001|..." -> {("8", "FIX.4.2"), ("35", "D"), ("11", "ORD001"), ...}
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    cin.ignore();

    // TODO: Initialize state tracking
    unordered_map<string, Order> orders;
    long long total_messages = 0;
    long long total_unique_orders = 0;
    // TODO: Add more counters as needed

    for (int i = 0; i < n; i++) {
        string line;
        getline(cin, line);
        total_messages++;

        unordered_map<string, string> msg;
        parse_fix_message(line, msg);

        // TODO: Extract message type and ClOrdID
        string msg_type = msg.count("35") ? msg["35"] : "";
        string clord_id = msg.count("11") ? msg["11"] : "";

        // TODO: Handle different message types
        if (msg_type == "D") {
            // NewOrderSingle: register new order
        } else if (msg_type == "8") {
            // ExecutionReport: update order state
        } else if (msg_type == "F") {
            // OrderCancelRequest: mark pending cancel
        } else if (msg_type == "9") {
            // OrderCancelReject: ignore
        }
    }

    // TODO: Calculate final metrics
    // - Count fully filled, partially filled, canceled, rejected orders
    // - Sum filled quantity and VWAP data
    // - Find symbol with highest filled quantity

    // TODO: Output results (one per line)
    cout << total_messages << "\n";
    cout << total_unique_orders << "\n";
    // TODO: Add remaining 10 outputs

    return 0;
}
