#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void) {
    char phone[20];
    printf("Enter phone number in format (555) 555-5555: ");
    fgets(phone, sizeof(phone), stdin);

    char *areaCodeStr = strtok(phone, "() -");
    char *first3 = strtok(NULL, "() -");
    char *last4 = strtok(NULL, "() -");

    char fullNumberStr[20] = "";
    if (first3 && last4) {
        strcat(fullNumberStr, first3);
        strcat(fullNumberStr, last4);
    }

    int areaCode = atoi(areaCodeStr);
    long phoneNumber = atol(fullNumberStr);

    printf("Area code (int): %d\n", areaCode);
    printf("Phone number (long): %ld\n", phoneNumber);

    return 0;
}